Skip to content

Commit a2e402c

Browse files
author
LocalIdentity
committed
Fix first glyph not snapping to pixel
The first glyph was not being snapped to a pixel so if scaling put the pixel coordinate at a fractional value it would look blurry
1 parent 921a8ec commit a2e402c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

engine/render/r_font.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ void r_font_c::DrawTextLine(scp_t pos, int align, int height, col4_t col, std::u
365365
}
366366
}
367367

368+
// Snap the starting x position to the pixel grid so the leading glyph isn't blurred.
369+
x = std::round(x);
370+
368371
r_tex_c* curTex{};
369372

370373
auto drawCodepoint = [this, &curTex, &x, y](f_fontHeight_s* fh, int height, float scale, int yShift, char32_t cp) {

0 commit comments

Comments
 (0)