LibGUI: Correct selection width when using fonts with glyph spacing

We were not adding the glyph spacing after the last character in the
selection, causing it to be slightly too small in some cases.
This commit is contained in:
Andreas Kling 2021-01-02 00:39:52 +01:00
parent c1339baba8
commit f5384d7c70
Notes: sideshowbarker 2024-07-19 00:13:52 +09:00

View file

@ -1666,7 +1666,7 @@ void TextEditor::for_each_visual_line(size_t line_index, Callback callback) cons
Gfx::IntRect visual_line_rect {
visual_data.visual_rect.x(),
visual_data.visual_rect.y() + ((int)visual_line_index * line_height()),
font().width(visual_line_view),
font().width(visual_line_view) + font().glyph_spacing(),
line_height()
};
if (is_right_text_alignment(text_alignment()))