From a6d8b2a8023631609e167984e437edd04f20c3e6 Mon Sep 17 00:00:00 2001 From: Drakulix Date: Fri, 9 Mar 2018 11:32:54 +0100 Subject: [PATCH] Fix winit transformed input --- src/backend/winit.rs | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/backend/winit.rs b/src/backend/winit.rs index c5f114e..f5f0d04 100644 --- a/src/backend/winit.rs +++ b/src/backend/winit.rs @@ -360,27 +360,21 @@ impl PointerMotionAbsoluteEvent for WinitMouseMovedEvent { } fn x_transformed(&self, width: u32) -> u32 { - cmp::min( - (self.x * width as f64 - / self.window - .window() - .get_inner_size() - .unwrap_or((width, 0)) - .0 as f64) as u32, - 0, - ) + (self.x * width as f64 + / self.window + .window() + .get_inner_size() + .unwrap_or((width, 0)) + .0 as f64) as u32 } fn y_transformed(&self, height: u32) -> u32 { - cmp::min( - (self.y * height as f64 - / self.window - .window() - .get_inner_size() - .unwrap_or((0, height)) - .1 as f64) as u32, - 0, - ) + (self.y * height as f64 + / self.window + .window() + .get_inner_size() + .unwrap_or((0, height)) + .1 as f64) as u32 } }