1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

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
parent 497c4c3858
commit ee3ac88c2d

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;