From f517cf0a68b9b5d7abc65b140c9df759684ef9c1 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Sun, 13 Jun 2021 19:26:00 -0700 Subject: [PATCH] handle horizontal scrolling on mac --- src/window/window_wrapper/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/window/window_wrapper/mod.rs b/src/window/window_wrapper/mod.rs index 4b449f6..9246afb 100644 --- a/src/window/window_wrapper/mod.rs +++ b/src/window/window_wrapper/mod.rs @@ -236,8 +236,8 @@ impl GlutinWindowWrapper { } let vertical_input_type = match y { - _ if y > 0.0 => Some("up"), - _ if y < 0.0 => Some("down"), + _ if y > 1.8 => Some("up"), + _ if y < -1.8 => Some("down"), _ => None, }; @@ -251,9 +251,9 @@ impl GlutinWindowWrapper { .ok(); } - let horizontal_input_type = match y { - _ if x > 0.0 => Some("right"), - _ if x < 0.0 => Some("left"), + let horizontal_input_type = match x { + _ if x > 1.8 => Some("right"), + _ if x < -1.8 => Some("left"), _ => None, }; @@ -334,7 +334,7 @@ impl GlutinWindowWrapper { .. }, .. - } => self.handle_mouse_wheel(0.0, logical_position.y as f32), + } => self.handle_mouse_wheel(logical_position.x as f32, logical_position.y as f32), Event::WindowEvent { event: WindowEvent::MouseInput {