summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-07-04 23:29:30 +0200
committerAndreas Kling <kling@serenityos.org>2022-07-05 00:48:59 +0200
commitd40167f7bb6f5ca5e0bb2dd8aaacf46441f1211c (patch)
treedbd5b09b2a5125944660a15b30f53787cc1172f6 /Userland
parent6e655b7f89bcff5b3adcbce292f2c973f3a3b5b1 (diff)
downloadserenity-d40167f7bb6f5ca5e0bb2dd8aaacf46441f1211c.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGfx/Painter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp
index d549b418d5..c6ce49562f 100644
--- a/Userland/Libraries/LibGfx/Painter.cpp
+++ b/Userland/Libraries/LibGfx/Painter.cpp
@@ -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;
}