commit c6b1fb3fd8fc197e5e0ca10f5d5d30a3fdd161a7
parent f7d24d2281007037f2fbdcaa96df9598d28a477a
Author: Remy Noulin <loader2x@gmail.com>
Date: Thu, 1 Dec 2022 12:36:38 +0200
fix last line in showStringHalfblockNoFullBlock
termfont.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/termfont.c b/termfont.c
@@ -338,9 +338,7 @@ void showStringHalfblockNoFullBlock(twidfont *font, char *string) {
u8 *p = pixels;
rangeFromStep(j, 1, font->height, 2) {
- u8 block = 0;
range(i, totalWidth) {
- block = (*(p + i)== ' ' ? 0 : 2) | (*(p + i + totalWidth)== ' ' ? 0 : 1);
if (*(p + i)== ' ')
printf("%k",0);
else
@@ -356,10 +354,13 @@ void showStringHalfblockNoFullBlock(twidfont *font, char *string) {
p += totalWidth * 2;
}
if (font->height & 1) {
- u8 block = 0;
range(i, totalWidth) {
- block = (*(p + i)== ' ' ? 0 : 2);
- printf(halfBlocks[block]);
+ if (*(p + i)== ' ')
+ printf("%k",0);
+ else
+ printf("%k", colors[j-1]);
+ printf(halfBlocks[2]);
+ printf(RST);
}
put;
}