You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a project that involves allowing the user to to dynamically move tiles around wherever they want. However, in the event that the layout gets too complicated and they want to start over, it'd be nice to be able to call Tree::reset_layout() (or something similar) to reset the layout (i.e. evenly space all of the tiles and remove their nesting)
I tried to achieve this with the following code:
// Get all of the tile ids in this tree except the current rootlet tile_ids = tree.tiles.tile_ids().filter(|id| id != &root).collect();// Insert all of the tile ids into a new grid tilelet new_root = tree.tiles.insert_grid_tile(tile_ids);// Update the root tile
tree.root = Some(new_root);
This actually did partially work, but only for non-nested layouts. If the tree contains any panes (split panes, tabs, etc), those tiles will be removed from the layout altogether.
Additionally, while I can't determine the exact cause, nor can I reliably reproduce it, this will occasionally cause a panic in tiles.rs:112:9: Failed to find rect for #10
The text was updated successfully, but these errors were encountered:
I'm working on a project that involves allowing the user to to dynamically move tiles around wherever they want. However, in the event that the layout gets too complicated and they want to start over, it'd be nice to be able to call
Tree::reset_layout()
(or something similar) to reset the layout (i.e. evenly space all of the tiles and remove their nesting)I tried to achieve this with the following code:
This actually did partially work, but only for non-nested layouts. If the tree contains any panes (split panes, tabs, etc), those tiles will be removed from the layout altogether.
Additionally, while I can't determine the exact cause, nor can I reliably reproduce it, this will occasionally cause a panic in
tiles.rs:112:9: Failed to find rect for #10
The text was updated successfully, but these errors were encountered: