summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorwrmr2025-08-30 04:04:25 -0400
committerwrmr2025-08-30 04:04:25 -0400
commit36896aea8f2502fb8100958ab5884edbc078d330 (patch)
tree22f0e33affbde5a3830c5bdae166dd50b9641273 /main.c
parenta98597527edf3a9df88d8b3cbb22ef972b40969a (diff)
fix gfx_draw_pic using byte count instead of width
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index 30af59c..4eb90e8 100644
--- a/main.c
+++ b/main.c
@@ -552,7 +552,7 @@ void gfx_draw_pic(Pic *pfp, int y, int x, int max_lines, int max_cols, PicDrawFl
int w = 0;
int h = MIN(pfp->lines, max_lines);
for (int i = 0; i < h; i++) {
- w = MAX(w, MIN(pfp->line[i].n, max_cols));
+ w = MAX(w, MIN(fast_utf8_width(pfp->line[i]), max_cols));
}
if (f & PIC_CTR_X) x -= w >> 1;
if (f & PIC_CTR_Y) y -= h >> 1;