Skip to content

Commit

Permalink
Fix move_tile_to_container behavior for grid-to-same-grid moves wit…
Browse files Browse the repository at this point in the history
…h reflow enabled (#53)

- Fixes #52
- Required for rerun-io/rerun#5081
  • Loading branch information
abey79 authored Feb 7, 2024
1 parent f9f8d6c commit e528aa0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,15 +523,14 @@ impl<Pane> Tree<Pane> {
linear.children.insert(insertion_index, moved_tile_id);
}
Container::Grid(grid) => {
let index = if reflow_grid {
adjusted_index
if reflow_grid {
self.tiles.insert_at(insertion_point, moved_tile_id);
} else {
dest_index
let dest_tile = grid.replace_at(dest_index, moved_tile_id);
if let Some(dest) = dest_tile {
grid.insert_at(source_index, dest);
}
};
let dest_tile = grid.replace_at(index, moved_tile_id);
if let Some(dest) = dest_tile {
grid.insert_at(source_index, dest);
}
}
}
return; // done
Expand Down

0 comments on commit e528aa0

Please # to comment.