1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibGfx: Always truncate glyph coordinates in Painter::draw_text_run()

This fixes an issue with glyphs jiggling 1px back and forth due to
inconsistent rounding.
This commit is contained in:
Andreas Kling 2022-07-04 23:29:30 +02:00
parent 6e655b7f89
commit d40167f7bb

View file

@ -2399,7 +2399,7 @@ void Painter::draw_text_run(FloatPoint const& baseline_start, Utf8View const& st
// FIXME: this is probably not the real space taken for complex emojis
x += font.glyphs_horizontal_kerning(last_code_point, code_point);
draw_glyph_or_emoji({ round_to<int>(x), y }, code_point_iterator, font, color);
draw_glyph_or_emoji({ static_cast<int>(x), y }, code_point_iterator, font, color);
x += font.glyph_or_emoji_width(code_point) + font.glyph_spacing();
last_code_point = code_point;
}