From 9702f3756a5a74b0e2fcd5cbb20bf4fb906a51fd Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 16 Jan 2024 13:49:55 +0100 Subject: [PATCH] better fix for the widget string width check --- src/hu_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hu_lib.c b/src/hu_lib.c index 149c4de1..0feac3a9 100644 --- a/src/hu_lib.c +++ b/src/hu_lib.c @@ -344,21 +344,21 @@ static void draw_line_aligned (const hu_multiline_t *m, const hu_line_t *l, cons { int w = SHORT(p[c-HU_FONTSTART]->width); - if (x+w > video.unscaledw) + if (x+w > right_margin + HU_GAPX) break; // killough 1/18/98 -- support multiple lines: V_DrawPatchTranslated(x, y, p[c-HU_FONTSTART], cr); x += w; } - else if ((x += f->space_width) >= video.unscaledw) + else if ((x += f->space_width) >= right_margin + HU_GAPX) break; } // draw the cursor if requested // killough 1/18/98 -- support multiple lines if (m->drawcursor && - x + SHORT(p['_'-HU_FONTSTART]->width) <= video.unscaledw && + x + SHORT(p['_'-HU_FONTSTART]->width) <= right_margin + HU_GAPX && leveltime & 16) { cr = m->cr; //jff 2/17/98 restore original color