fix duplicate id in tree viewer
This commit is contained in:
parent
7a3d51a626
commit
db8657bb96
1 changed files with 20 additions and 17 deletions
|
@ -71,7 +71,7 @@ pub fn action_bar_sys(
|
|||
|
||||
pub fn shape_tree_sys(
|
||||
mut egui_ctx: ResMut<EguiContext>,
|
||||
shapes: Query<&ShapeData>,
|
||||
shapes: Query<(Entity, &ShapeData)>,
|
||||
mut transforms: Query<&mut Transform>,
|
||||
) {
|
||||
if !shapes.is_empty() {
|
||||
|
@ -80,7 +80,9 @@ pub fn shape_tree_sys(
|
|||
.title_bar(true)
|
||||
.resizable(false)
|
||||
.show(egui_ctx.ctx_mut(), |ui| {
|
||||
for sd in shapes.iter() {
|
||||
for (e, sd) in shapes.iter() {
|
||||
ui.push_id(e.id(), |ui| {
|
||||
|
||||
ui.collapsing(format!("{:?}", sd.shape), |ui| {
|
||||
|
||||
if let Ok(mut t) = transforms.get_mut(sd.main_shape) {
|
||||
|
@ -98,6 +100,7 @@ pub fn shape_tree_sys(
|
|||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue