From eecf60767ae4386337a7d164f9304571df6cb61b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 9 Apr 2021 15:44:04 +0200 Subject: [PATCH] LibGfx: Make draw_ui_text() underlines take glyph spacing into account Without this, the underline was ending up too far to the left. --- Userland/Libraries/LibGfx/Painter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGfx/Painter.cpp b/Userland/Libraries/LibGfx/Painter.cpp index 389152c7ef..6c53f9a4c9 100644 --- a/Userland/Libraries/LibGfx/Painter.cpp +++ b/Userland/Libraries/LibGfx/Painter.cpp @@ -1846,7 +1846,7 @@ void Gfx::Painter::draw_ui_text(const Gfx::IntRect& rect, const StringView& text draw_line({ x1, y }, { x2, y }, Color::Black); break; } - width += font.glyph_or_emoji_width(*it); + width += font.glyph_or_emoji_width(*it) + font.glyph_spacing(); } } }