From b3647d69c4eca914ab49b3511f67e322090b1946 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Fri, 17 Jan 2020 17:53:45 -0800 Subject: [PATCH] fix scroll positioning --- src/window.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/window.rs b/src/window.rs index ca5377d..b3e75ce 100644 --- a/src/window.rs +++ b/src/window.rs @@ -161,8 +161,7 @@ pub fn ui_loop(editor: Arc>, mut command_channel: UnboundedSender< }; if let Some(input_type) = vertical_input_type { - let (grid_y, grid_x) = mouse_pos; - command_channel.send(UiCommand::Scroll { direction: input_type.to_string(), position: (grid_x, grid_y) }); + command_channel.send(UiCommand::Scroll { direction: input_type.to_string(), position: mouse_pos }); } let horizontal_input_type = if horizontal > 0.0 { @@ -174,8 +173,7 @@ pub fn ui_loop(editor: Arc>, mut command_channel: UnboundedSender< }; if let Some(input_type) = horizontal_input_type { - let (grid_y, grid_x) = mouse_pos; - command_channel.send(UiCommand::Scroll { direction: input_type.to_string(), position: (grid_x, grid_y) }); + command_channel.send(UiCommand::Scroll { direction: input_type.to_string(), position: mouse_pos }); } }