summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/TextEditor.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-24 19:14:22 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-24 19:14:22 +0200
commitc350bb9178fd4d82f2816e22e495550f700da6e9 (patch)
tree2ee7ecc167b74f2574a8559c1f7c4276e528f4d9 /Libraries/LibGUI/TextEditor.cpp
parent344e66caaaa63e17d9a33e69d03c38bbdee72fff (diff)
downloadserenity-c350bb9178fd4d82f2816e22e495550f700da6e9.zip
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.
Diffstat (limited to 'Libraries/LibGUI/TextEditor.cpp')
-rw-r--r--Libraries/LibGUI/TextEditor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibGUI/TextEditor.cpp b/Libraries/LibGUI/TextEditor.cpp
index c6e399775f..0f6e0e005d 100644
--- a/Libraries/LibGUI/TextEditor.cpp
+++ b/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();