Skip to content

Commit

Permalink
fix: Inverse mouse scroll wheel on Linux (#585)
Browse files Browse the repository at this point in the history
* fix: Inverse mouse scroll wheel on Linux

* Add changelog file

* Update .changes/linux-inversed-mouse-wheel.md

Co-authored-by: Amr Bashir <[email protected]>

Co-authored-by: Amr Bashir <[email protected]>
  • Loading branch information
marc2332 and amrbashir authored Oct 11, 2022
1 parent a50fd86 commit 8451f75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/linux-inversed-mouse-wheel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"tao": patch
---

Fix inverted delta in `WindowEvent::MouseWheel` on Linux
2 changes: 1 addition & 1 deletion src/platform_impl/linux/event_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ impl<T: 'static> EventLoop<T> {
window_id: RootWindowId(id),
event: WindowEvent::MouseWheel {
device_id: DEVICE_ID,
delta: MouseScrollDelta::LineDelta(x as f32, y as f32),
delta: MouseScrollDelta::LineDelta(-x as f32, -y as f32),
phase: match event.direction() {
ScrollDirection::Smooth => TouchPhase::Moved,
_ => TouchPhase::Ended,
Expand Down

0 comments on commit 8451f75

Please sign in to comment.