summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/AbstractView.cpp
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-10-20 10:21:00 -0600
committerAndreas Kling <kling@serenityos.org>2020-10-22 15:23:45 +0200
commit307f0bc7789b4ead4f1fe1685f94409ddf2ff8f6 (patch)
treedc9c22b68b50bea196e062b32d1787fdbcc49f1c /Libraries/LibGUI/AbstractView.cpp
parenta823d2a9629491ed4c1661a940d36f2ce8184ef1 (diff)
downloadserenity-307f0bc7789b4ead4f1fe1685f94409ddf2ff8f6.zip
LibGUI: Fix scroll_into_view flipping between left/top and right/bottom
This fixes flipping between left/top and right/bottom when the rectangle to make visible doesn't fit into the visible portion each time the function is called.
Diffstat (limited to 'Libraries/LibGUI/AbstractView.cpp')
-rw-r--r--Libraries/LibGUI/AbstractView.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/Libraries/LibGUI/AbstractView.cpp b/Libraries/LibGUI/AbstractView.cpp
index 1b2d43e1ba..d51656ff0e 100644
--- a/Libraries/LibGUI/AbstractView.cpp
+++ b/Libraries/LibGUI/AbstractView.cpp
@@ -438,10 +438,8 @@ void AbstractView::set_cursor(ModelIndex index, SelectionUpdate selection_update
m_cursor_index = index;
- if (scroll_cursor_into_view) {
- // FIXME: We should scroll into view both vertically *and* horizontally.
- scroll_into_view(index, false, true);
- }
+ if (scroll_cursor_into_view)
+ scroll_into_view(index, true, true);
update();
}
}