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 4, 2024
1 parent 388c40b commit 8c00428
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Unreleased` header.
- **Breaking:** Removed `EventLoopBuilder::with_user_event`, the functionality is now available in `EventLoop::with_user_event`.
- Add `Window::default_attributes` to get default `WindowAttributes`.
- `log` has been replaced with `tracing`. The old behavior can be emulated by setting the `log` feature on the `tracing` crate.
- On X11, fix a bug where some mouse events would be unexpectedly filtered out.

# 0.29.13

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 8c00428

Please sign in to comment.