do not check line length against right margin value

This commit is contained in:
Fabian Greffrath 2024-01-16 08:35:14 +01:00
parent 083825d282
commit 9b7d4c884e

View File

@ -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); int w = SHORT(p[c-HU_FONTSTART]->width);
if (x+w > right_margin) if (x+w > video.unscaledw)
break; break;
// killough 1/18/98 -- support multiple lines: // killough 1/18/98 -- support multiple lines:
V_DrawPatchTranslated(x, y, p[c-HU_FONTSTART], cr); V_DrawPatchTranslated(x, y, p[c-HU_FONTSTART], cr);
x += w; x += w;
} }
else if ((x += f->space_width) >= right_margin) else if ((x += f->space_width) >= video.unscaledw)
break; break;
} }
// draw the cursor if requested // draw the cursor if requested
// killough 1/18/98 -- support multiple lines // killough 1/18/98 -- support multiple lines
if (m->drawcursor && if (m->drawcursor &&
x + SHORT(p['_'-HU_FONTSTART]->width) < right_margin && x + SHORT(p['_'-HU_FONTSTART]->width) <= video.unscaledw &&
leveltime & 16) leveltime & 16)
{ {
cr = m->cr; //jff 2/17/98 restore original color cr = m->cr; //jff 2/17/98 restore original color