bugfix(x11): fix incorrect delta filtering

Invert the mouse delta filter, so it aligns with the intention of
filtering values lower than epsilon.

Signed-off-by: John Nunley <dev@notgull.net>
Closes: https://github.com/rust-windowing/winit/issues/3558
This commit is contained in:
John Nunley 2024-03-02 14:10:14 -08:00 committed by Kirill Chibisov
parent 388c40b1e0
commit f6f1c45a72
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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),
};