FIX: dynamic width detection

This commit is contained in:
Patrick Haßel 2025-01-25 21:27:47 +01:00
parent 8e5a4e2501
commit 56dda350b4

View File

@ -159,7 +159,7 @@ public:
void print(int x, int y, const RGBA color, const char *message) { void print(int x, int y, const RGBA color, const char *message) {
while (*message != '\0') { while (*message != '\0') {
print(&x, &y, color, &message); print(&x, &y, color, &message);
x += 2; // space between characters x += 1; // space between characters
} }
} }
@ -255,7 +255,7 @@ public:
const auto pixelY = *y0 + y; const auto pixelY = *y0 + y;
if (active) { if (active) {
setPixel(pixelX, pixelY, color); setPixel(pixelX, pixelY, color);
maxWidth = max(x, maxWidth); maxWidth = max(x + 1, maxWidth);
} }
} }
} }