Skip to content

Commit

Permalink
Match mouse button instead of inequality check
Browse files Browse the repository at this point in the history
  • Loading branch information
Zakru committed Sep 7, 2023
1 parent 4ac876e commit 52aa6bf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/controller/src/hud/minimap/interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ fn press_handler(
let cursor = window_query.single().cursor_position();

for event in input_events.iter() {
if event.state != ButtonState::Pressed {
dragging.retain(|b| *b != event.button);
continue;
match event.state {
ButtonState::Released => {
dragging.retain(|b| *b != event.button);
continue;
},
ButtonState::Pressed => (),
}

let Some(cursor) = cursor else {
Expand Down

0 comments on commit 52aa6bf

Please sign in to comment.