From c63c3a6a7c082f5c1244ea5069afadccd45857aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kalle=20L=C3=B6fgren?= <kalle.lofgren94@gmail.com>
Date: Mon, 3 May 2021 09:47:42 +0000
Subject: [PATCH] Update Project_Mouse.rs

---
 code/Project_Mouse.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/code/Project_Mouse.rs b/code/Project_Mouse.rs
index 0b5c49d..5bc5c14 100644
--- a/code/Project_Mouse.rs
+++ b/code/Project_Mouse.rs
@@ -304,16 +304,16 @@ const APP: () = {
         
         let (x, y) = cx.resources.pmw3389.read_status().unwrap();
         //rprintln!("{} {}", x as i64, y as i64);
-        POS_X += x as i64;
-        POS_Y += y as i64;
+        POS_X = x as f32;
+        POS_Y = y as f32;
         let report = PMouseReport {
             buttons: ((M1_click.is_high().unwrap() as u8) << 4
                 | (M2_click.is_high().unwrap() as u8) << 3
                 | (w_click.is_high().unwrap() as u8) << 2
                 | (r_click.is_high().unwrap() as u8) << 1
                 | (l_click.is_high().unwrap() as u8)),
-            x: (-x as i8)>>1,
-            y: (-y as i8)>>1,
+            x: ((-POS_X * *myScaler) as i8)>>1,
+            y: ((-POS_Y * *myScaler) as i8)>>1,
             wheel: wheel_count,
         };
         hid.push_input(&report).ok();
-- 
GitLab