Skip to content

Commit

Permalink
Render picked pane last
Browse files Browse the repository at this point in the history
  • Loading branch information
tarkah committed Oct 17, 2022
1 parent dca99f3 commit fb03652
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion native/src/widget/pane_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,12 @@ pub fn draw<Renderer, T>(
cursor_position
};

for ((id, pane), layout) in elements.zip(layout.children()) {
// Render picked pane last
let mut elements = elements.zip(layout.children()).collect::<Vec<_>>();
elements
.sort_by_key(|((id, _), _)| picked_pane.map(|(id, _)| id) == Some(*id));

for ((id, pane), layout) in elements {
match picked_pane {
Some((dragging, origin)) if id == dragging => {
let bounds = layout.bounds();
Expand Down

0 comments on commit fb03652

Please sign in to comment.