From dad70d8d6e1fc3d32407d7aa80f0e7ea031e4ecb Mon Sep 17 00:00:00 2001 From: Cameron Youell Date: Thu, 16 Feb 2023 18:21:45 +1100 Subject: LibGUI: Account for `glyph_spacing()` in spans --- Userland/Libraries/LibGUI/TextEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 871f496068..62896900d8 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -572,7 +572,7 @@ void TextEditor::paint_event(PaintEvent& event) if (length == 0) return; auto text = visual_line_text.substring_view(start, length); - span_rect.set_width(font->width(text)); + span_rect.set_width(font->width(text) + font->glyph_spacing()); if (text_attributes.background_color.has_value()) { painter.fill_rect(span_rect, text_attributes.background_color.value()); } -- cgit v1.2.3