Update crates/bevy_ui/src/focus.rs

Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
This commit is contained in:
Chamaloriz 2025-07-12 17:42:58 +02:00 committed by GitHub
parent 180416fc89
commit 2eb69d5bcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -267,7 +267,7 @@ pub fn ui_focus_system(
// Save the relative cursor position to the correct component
if let Some(mut node_relative_cursor_position_component) = node.relative_cursor_position
{
// Check that the values are different before save to enable Changed<> query filter
// Avoid triggering change detection when not necessary.
node_relative_cursor_position_component.set_if_neq(relative_cursor_position_component);
}