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
This commit is contained in:
Tom 2021-03-28 15:04:05 -06:00 committed by Andreas Kling
commit ee3ac88c2d
Notes: sideshowbarker 2024-07-18 20:59:16 +09:00

View file

@ -820,7 +820,7 @@ inline IterationDecision IconView::for_each_item_intersecting_rect(const Gfx::In
return decision; 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; return IterationDecision::Continue;