]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Diagonal micro move fix
authorEvgeniy Petukhov <evgeniy.petukhov@gmail.com>
Thu, 7 Jun 2018 20:00:37 +0000 (23:00 +0300)
committerJack Humbert <jack.humb@gmail.com>
Fri, 29 Jun 2018 02:10:53 +0000 (22:10 -0400)
tmk_core/common/mousekey.c

index aa128f0e87dd17eea205f6518ef0f5a9deb3def0..581e7b8a07250c4dd10f2dabab7b647cc2b92051 100644 (file)
@@ -122,7 +122,9 @@ void mousekey_task(void)
     /* diagonal move [1/sqrt(2)] */
     if (mouse_report.x && mouse_report.y) {
         mouse_report.x = times_inv_sqrt2(mouse_report.x);
+        mouse_report.x = mouse_report.x == 0 ? 1 : mouse_report.x;
         mouse_report.y = times_inv_sqrt2(mouse_report.y);
+        mouse_report.y = mouse_report.y == 0 ? 1 : mouse_report.y;
     }
 
     if (mouse_report.v > 0) mouse_report.v = wheel_unit();