LibGfx: Add the glyph spacing also to spaces in Painter::draw_text_run()

This caused the text selection not to match the selected glyph after
some words.
This commit is contained in:
Karol Kosek 2022-05-08 21:00:37 +02:00 committed by Andreas Kling
commit 8a9211de4b
Notes: sideshowbarker 2024-07-17 11:07:45 +09:00

View file

@ -2327,7 +2327,7 @@ void Painter::draw_text_run(FloatPoint const& baseline_start, Utf8View const& st
for (auto code_point_iterator = string.begin(); code_point_iterator != string.end(); ++code_point_iterator) {
auto code_point = *code_point_iterator;
if (code_point == ' ') {
x += space_width;
x += space_width + font.glyph_spacing();
last_code_point = code_point;
continue;
}