Skip to content

Commit

Permalink
When removing a tile, remove it from the parent child list
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Jan 2, 2024
1 parent 93e72d0 commit 198c635
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ impl<Pane> Tiles<Pane> {
///
/// All removed tiles are returned in unspecified order.
pub fn remove_recursively(&mut self, id: TileId) -> Vec<Tile<Pane>> {
// Remove the top tile_id from its parent
for tile in self.tiles.values_mut() {
if let Tile::Container(container) = tile {
container.remove_child(id);
}
}

let mut removed_tiles = vec![];
self.remove_recursively_impl(id, &mut removed_tiles);
removed_tiles
Expand Down

0 comments on commit 198c635

Please sign in to comment.