Browse Source

LibGUI: Fix laggy mouse selection in TextEditor widget

We were letting the automatic scrolling timer drive all selection
updates to fix an unwanted acceleration that was happening. However,
if a mousemove occurs *within* the editor widget, we should just
handle it right then and there.
Andreas Kling 5 năm trước cách đây
mục cha
commit
c350bb9178
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Libraries/LibGUI/TextEditor.cpp

+ 1 - 1
Libraries/LibGUI/TextEditor.cpp

@@ -301,7 +301,7 @@ void TextEditor::mouseup_event(MouseEvent& event)
 void TextEditor::mousemove_event(MouseEvent& event)
 {
     m_last_mousemove_position = event.position();
-    if (m_in_drag_select && !m_automatic_selection_scroll_timer->is_active()) {
+    if (m_in_drag_select && (rect().contains(event.position()) || !m_automatic_selection_scroll_timer->is_active())) {
         set_cursor(text_position_at(event.position()));
         m_selection.set_end(m_cursor);
         did_update_selection();