Просмотр исходного кода

LibGUI: Account for `glyph_spacing()` in spans

Cameron Youell 2 лет назад
Родитель
Сommit
dad70d8d6e
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      Userland/Libraries/LibGUI/TextEditor.cpp

+ 1 - 1
Userland/Libraries/LibGUI/TextEditor.cpp

@@ -572,7 +572,7 @@ void TextEditor::paint_event(PaintEvent& event)
                     if (length == 0)
                     if (length == 0)
                         return;
                         return;
                     auto text = visual_line_text.substring_view(start, length);
                     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()) {
                     if (text_attributes.background_color.has_value()) {
                         painter.fill_rect(span_rect, text_attributes.background_color.value());
                         painter.fill_rect(span_rect, text_attributes.background_color.value());
                     }
                     }