Skip to content

Commit

Permalink
Fix cursor behavior on Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
yescallop committed Nov 20, 2024
1 parent 8dcb034 commit 3b2d682
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/src/game_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,12 +602,16 @@ pub fn GameView(
return;
}

// We can also get a `mouseover` event, because Firefox does not fire a
// `pointerover` event after a dialog is closed.
if let Some(id) = po.id {
if let Some(pointer) = state.down_pointers.get_mut(&id) {
pointer.last = po;
}
} else {
// Firefox does not fire a `pointerover` event after a dialog is closed,
// so we accept `mouseover` as a replacement. We bail out here, because
// a spurious `mouseover` event can fire on Chrome when touching the
// screen on startup or after a dialog is closed.
return;
}

if state.down_pointers.is_empty() {
Expand Down

0 comments on commit 3b2d682

Please sign in to comment.