Jelajahi Sumber

GTextEditor: Take horizontal padding into account for line visual rects

Andreas Kling 6 tahun lalu
induk
melakukan
2e31b6627e
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      Libraries/LibGUI/GTextEditor.cpp

+ 2 - 2
Libraries/LibGUI/GTextEditor.cpp

@@ -1289,9 +1289,9 @@ void GTextEditor::Line::recompute_visual_lines()
     m_visual_line_breaks.append(length());
 
     if (m_editor.is_line_wrapping_enabled())
-        m_visual_rect = { 0, 0, available_width, m_visual_line_breaks.size() * m_editor.line_height() };
+        m_visual_rect = { m_editor.m_horizontal_content_padding, 0, available_width, m_visual_line_breaks.size() * m_editor.line_height() };
     else
-        m_visual_rect = { 0, 0, m_editor.font().width(view()), m_editor.line_height() };
+        m_visual_rect = { m_editor.m_horizontal_content_padding, 0, m_editor.font().width(view()), m_editor.line_height() };
 }
 
 template<typename Callback>