libnmc-base/utils: Improve qr code bottom border

The bottom border of the generated QR code had a different thickness
compared to other borders.

Improve it by using Upper Half Block so that all borders have similar
thickness.

(cherry picked from commit d9b06a95c9)
This commit is contained in:
Mohammed Sadiq 2023-09-21 16:33:47 +05:30 committed by Beniamino Galvani
parent 885bc80d29
commit cef00ac0f7

View file

@ -712,6 +712,9 @@ nmc_print_qrcode(const char *str)
bool bottom = qrcodegen_getModule(qrcode, x, y + 1);
if (top) {
g_print(bottom ? " " : "\u2584");
} else if (y > size) {
/* Print the last line (the bottom QR border) in light gray, no bg color */
g_print("\033[0;37m\u2580");
} else {
g_print(bottom ? "\u2580" : "\u2588");
}