summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCameron Youell <cameronyouell@gmail.com>2023-02-16 18:21:45 +1100
committerSam Atkins <atkinssj@gmail.com>2023-02-16 10:47:22 +0000
commitdad70d8d6e1fc3d32407d7aa80f0e7ea031e4ecb (patch)
tree01241ad76b6d646cae607d5501d5e1aaefb88340
parent32a01a60e7cc482c9d2fd837c8d91833c2255740 (diff)
downloadserenity-dad70d8d6e1fc3d32407d7aa80f0e7ea031e4ecb.zip
LibGUI: Account for `glyph_spacing()` in spans
-rw-r--r--Userland/Libraries/LibGUI/TextEditor.cpp2
1 files changed, 1 insertions, 1 deletions
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());
}