Skip to content

Commit

Permalink
use set_if_neq
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Jan 11, 2023
1 parent 82220d0 commit 1eb078f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/bevy_ui/src/focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ pub fn ui_focus_system(
// Reset their interaction to None to avoid strange stuck state
if let Some(mut interaction) = node.interaction {
// We cannot simply set the interaction to None, as that will trigger change detection repeatedly
if *interaction != Interaction::None {
*interaction = Interaction::None;
}
interaction.set_if_neq(Interaction::None);
}

return None;
Expand Down

0 comments on commit 1eb078f

Please sign in to comment.