Skip to content

Commit

Permalink
bugfix(x11): fix incorrect delta filtering
Browse files Browse the repository at this point in the history
Invert the mouse delta filter, so it aligns with the intention of
filtering values lower than epsilon.

Signed-off-by: John Nunley <[email protected]>
Closes: #3558
  • Loading branch information
notgull authored and kchibisov committed Mar 6, 2024
1 parent b1dad45 commit 7601a15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Unreleased` header.

# Unreleased

- On X11, fix a bug where some mouse events would be unexpectedly filtered out.

# 0.29.13

- On Web, fix possible crash with `ControlFlow::Wait` and `ControlFlow::WaitUntil`.
Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/linux/x11/util/mouse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ macro_rules! consume {
let this = $this;
let (x, y) = match (this.x.abs() < <$ty>::EPSILON, this.y.abs() < <$ty>::EPSILON) {
(true, true) => return None,
(true, false) => (this.x, 0.0),
(false, true) => (0.0, this.y),
(false, true) => (this.x, 0.0),
(true, false) => (0.0, this.y),
(false, false) => (this.x, this.y),
};

Expand Down

0 comments on commit 7601a15

Please sign in to comment.