From ee3ac88c2dcc0a26ad48b439825ef8c4f7d957ad Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 28 Mar 2021 15:04:05 -0600 Subject: [PATCH] LibGUI: Fix IconView selection with FlowDirection::TopToBottom While iterating the items contained by the rubberband we need to skip the correct number of items either vertically or horizontally, depending on which direction the items flow. Fixes #5993 --- Userland/Libraries/LibGUI/IconView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/IconView.cpp b/Userland/Libraries/LibGUI/IconView.cpp index 9179c4d06b..7d1a840dc3 100644 --- a/Userland/Libraries/LibGUI/IconView.cpp +++ b/Userland/Libraries/LibGUI/IconView.cpp @@ -820,7 +820,7 @@ inline IterationDecision IconView::for_each_item_intersecting_rect(const Gfx::In return decision; } } - item_index += m_visual_column_count; + item_index += (m_flow_direction == FlowDirection::LeftToRight) ? m_visual_column_count : m_visual_row_count; }; return IterationDecision::Continue;