From f917fbd199414d3a6417a0e7e2108e348521e5eb Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 2 Mar 2024 20:41:25 -0800 Subject: [PATCH] Ignore patch X offset when drawing fonts We don't typically use offsets for font graphics anyway. But I had to add offsets to the console font specifically, because the console doesn't render text with the normal drawing functions. --- src/v_video.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/v_video.cpp b/src/v_video.cpp index 1db7bd01c..06991d0e5 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -2702,9 +2702,11 @@ void V_DrawStringScaled( c -= font->start; if (V_CharacterValid(font, c) == true) { + // Remove offsets from patch + fixed_t patchxofs = SHORT (font->font[c]->leftoffset) * dupx * FRACUNIT; cw = SHORT (font->font[c]->width) * dupx; cxoff = (*fontspec.dim_fn)(scale, fontspec.chw, hchw, dupx, &cw); - V_DrawFixedPatch(cx + cxoff, cy + cyoff, scale, + V_DrawFixedPatch(cx + cxoff + patchxofs, cy + cyoff, scale, flags, font->font[c], colormap); cx += cw; }