Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
oceantume committed Sep 4, 2022
1 parent 04e5d7a commit 321de09
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions crates/bevy_ui/src/focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,14 @@ pub fn ui_focus_system(

if contains_cursor {
return Some(entity);
} else {
if let Some(mut interaction) = interaction {
if *interaction == Interaction::Hovered
|| (cursor_position.is_none() && *interaction != Interaction::None)
{
*interaction = Interaction::None;
}
} else if let Some(mut interaction) = interaction {
if *interaction == Interaction::Hovered
|| (cursor_position.is_none() && *interaction != Interaction::None)
{
*interaction = Interaction::None;
}
return None;
}
return None;
}
None
})
Expand Down Expand Up @@ -210,12 +208,10 @@ pub fn ui_focus_system(
}
// reset lower nodes to None
for entity in &moused_over_nodes {
if let Ok((_, _, _, interaction, _, _, _)) = node_query.get_mut(*entity) {
if let Some(mut interaction) = interaction {
// don't reset clicked nodes because they're handled separately
if *interaction != Interaction::Clicked && *interaction != Interaction::None {
*interaction = Interaction::None;
}
if let Ok((_, _, _, Some(mut interaction), _, _, _)) = node_query.get_mut(*entity) {
// don't reset clicked nodes because they're handled separately
if *interaction != Interaction::Clicked && *interaction != Interaction::None {
*interaction = Interaction::None;
}
}
}
Expand Down

0 comments on commit 321de09

Please sign in to comment.