Procházet zdrojové kódy

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.
Karol Kosek před 3 roky
rodič
revize
8a9211de4b
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      Userland/Libraries/LibGfx/Painter.cpp

+ 1 - 1
Userland/Libraries/LibGfx/Painter.cpp

@@ -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;
         }