From 506e830cb0bb28c8be706df9116f0ddc23015df6 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Mon, 17 Jul 2017 22:50:47 -0700 Subject: [PATCH] Fix X11 scroll direction This was inconsistent with the documented semantics of MouseScrollDelta. --- src/platform/linux/x11/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platform/linux/x11/mod.rs b/src/platform/linux/x11/mod.rs index 4e71a522..66fee12a 100644 --- a/src/platform/linux/x11/mod.rs +++ b/src/platform/linux/x11/mod.rs @@ -413,7 +413,8 @@ impl EventsLoop { device_id: did, delta: match info.orientation { ScrollOrientation::Horizontal => LineDelta(delta as f32, 0.0), - ScrollOrientation::Vertical => LineDelta(0.0, delta as f32), + // X11 vertical scroll coordinates are opposite to winit's + ScrollOrientation::Vertical => LineDelta(0.0, -delta as f32), }, phase: TouchPhase::Moved, }});