mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-28 08:58:07 +00:00
Fix selection highlight for primitives
This commit is contained in:
@@ -213,22 +213,30 @@ fn draw_selection_outline(
|
|||||||
cmd.entity(ent).remove::<OutlineBundle>();
|
cmd.entity(ent).remove::<OutlineBundle>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(selected_children) = r_selection
|
let Some(selection) = r_selection else {
|
||||||
.as_ref()
|
return;
|
||||||
.and_then(|selection| q_children.get(***selection).ok())
|
};
|
||||||
{
|
|
||||||
for &child in selected_children.iter() {
|
let target = if q_meshes.contains(**selection) {
|
||||||
if q_meshes.contains(child) {
|
Some(**selection)
|
||||||
cmd.entity(child).insert(OutlineBundle {
|
} else {
|
||||||
outline: OutlineVolume {
|
q_children.get(**selection).ok().and_then(|children| {
|
||||||
visible: true,
|
children
|
||||||
width: 4.,
|
.iter()
|
||||||
colour: Color::YELLOW,
|
.copied()
|
||||||
},
|
.find(|&child| q_meshes.contains(child))
|
||||||
..default()
|
})
|
||||||
});
|
};
|
||||||
}
|
|
||||||
}
|
if let Some(target) = target {
|
||||||
|
cmd.entity(target).insert(OutlineBundle {
|
||||||
|
outline: OutlineVolume {
|
||||||
|
visible: true,
|
||||||
|
width: 4.,
|
||||||
|
colour: Color::YELLOW,
|
||||||
|
},
|
||||||
|
..default()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user