From 3f2deedb93d134a18a3cec650dff77e9c45d2b9d Mon Sep 17 00:00:00 2001 From: Grey Date: Tue, 21 Feb 2023 07:20:21 +0800 Subject: [PATCH] Always recompute outline depth when SetOutlineDepth is changed (#10). Signed-off-by: Michael X. Grey --- src/computed.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/computed.rs b/src/computed.rs index 9655fd2..40477f2 100644 --- a/src/computed.rs +++ b/src/computed.rs @@ -37,10 +37,9 @@ pub(crate) fn compute_outline_depth( child_query: Query<(&Children, Changed)>, ) { 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,