Browse Source

TextEditor: Fix highlighting bug in wrapping mode

Before this patch the highlighted rectangle wasn't placed on the right
spot. Now the red highlighting is correctly placed at the end of the
line. This was due to a function called with a wrong argument.
Lucas CHOLLET 3 years ago
parent
commit
9c2e89e8b8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/Libraries/LibGUI/TextEditor.cpp

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

@@ -652,7 +652,7 @@ void TextEditor::paint_event(PaintEvent& event)
                 if (physical_column < end_of_visual_line) {
                 if (physical_column < end_of_visual_line) {
                     size_t visual_column = physical_column > start_of_visual_line ? (physical_column - start_of_visual_line) : 0;
                     size_t visual_column = physical_column > start_of_visual_line ? (physical_column - start_of_visual_line) : 0;
                     Gfx::IntRect whitespace_rect {
                     Gfx::IntRect whitespace_rect {
-                        content_x_for_position({ line_index, visual_column }),
+                        content_x_for_position({ line_index, physical_column }),
                         visual_line_rect.y(),
                         visual_line_rect.y(),
                         text_width_for_font(visual_line_text.substring_view(visual_column, visual_line_text.length() - visual_column), font()),
                         text_width_for_font(visual_line_text.substring_view(visual_column, visual_line_text.length() - visual_column), font()),
                         visual_line_rect.height()
                         visual_line_rect.height()