diff --git a/crates/bevy_ui/src/stack.rs b/crates/bevy_ui/src/stack.rs index eb50331862b5d..7591574da2d3f 100644 --- a/crates/bevy_ui/src/stack.rs +++ b/crates/bevy_ui/src/stack.rs @@ -108,7 +108,7 @@ pub fn ui_stack_system( for (i, entity) in ui_stack.uinodes.iter().enumerate() { if let Ok(mut stack_index) = update_query.get_mut(*entity) { - stack_index.0 = i as u32; + stack_index.set_if_neq(ComputedStackIndex(i as u32)); } } }