Fix outline depth being propagated onto children without InheritOutlineDepth.

This commit is contained in:
Robin KAY 2023-03-16 01:27:06 +00:00
parent d84e476c78
commit 2a4184ab32
1 changed files with 8 additions and 2 deletions

View File

@ -35,7 +35,10 @@ pub(crate) fn compute_outline_depth(
), ),
Without<InheritOutlineDepth>, Without<InheritOutlineDepth>,
>, >,
mut computed_query: Query<(&mut ComputedOutlineDepth, Changed<InheritOutlineDepth>)>, mut computed_query: Query<
(&mut ComputedOutlineDepth, Changed<InheritOutlineDepth>),
With<InheritOutlineDepth>,
>,
child_query: Query<(&Children, Changed<Children>)>, child_query: Query<(&Children, Changed<Children>)>,
) { ) {
for (mut computed, transform, changed_transform, set_depth, children) in root_query.iter_mut() { for (mut computed, transform, changed_transform, set_depth, children) in root_query.iter_mut() {
@ -75,7 +78,10 @@ fn propagate_outline_depth(
root_computed: &ComputedOutlineDepth, root_computed: &ComputedOutlineDepth,
mut changed: bool, mut changed: bool,
entity: Entity, entity: Entity,
computed_query: &mut Query<(&mut ComputedOutlineDepth, Changed<InheritOutlineDepth>)>, computed_query: &mut Query<
(&mut ComputedOutlineDepth, Changed<InheritOutlineDepth>),
With<InheritOutlineDepth>,
>,
child_query: &Query<(&Children, Changed<Children>)>, child_query: &Query<(&Children, Changed<Children>)>,
) { ) {
if let Ok((mut computed, changed_inherit)) = computed_query.get_mut(entity) { if let Ok((mut computed, changed_inherit)) = computed_query.get_mut(entity) {