Always recompute outline depth when SetOutlineDepth is changed (#10).

Signed-off-by: Michael X. Grey <grey@openrobotics.org>
This commit is contained in:
Grey 2023-02-21 07:20:21 +08:00 committed by GitHub
parent db6d6f6722
commit 3f2deedb93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,10 +37,9 @@ pub(crate) fn compute_outline_depth(
child_query: Query<(&Children, Changed<Children>)>,
) {
for (mut computed, transform, changed_transform, set_depth, children) in root_query.iter_mut() {
let mut changed = changed_transform;
let mut changed = changed_transform || set_depth.filter(|(_, c)| *c).is_some();
if changed {
let (origin, flat) = if let Some((sd, sd_changed)) = set_depth {
changed |= sd_changed;
let (origin, flat) = if let Some((sd, _)) = set_depth {
match sd {
SetOutlineDepth::Flat {
model_origin: origin,