[Bf-blender-cvs] [ff4ffb18d42] master: Fix T67924: transform right/up arrow keys not working on macOS

Brecht Van Lommel noreply at git.blender.org
Sat Feb 15 13:44:38 CET 2020


Commit: ff4ffb18d420852cb20c4c9bb75b6f50277bfcac
Author: Brecht Van Lommel
Date:   Sat Feb 15 09:48:21 2020 +0100
Branches: master
https://developer.blender.org/rBff4ffb18d420852cb20c4c9bb75b6f50277bfcac

Fix T67924: transform right/up arrow keys not working on macOS

===================================================================

M	source/blender/windowmanager/intern/wm_cursors.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index e22863bc602..1721e84767d 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -341,20 +341,23 @@ static void wm_cursor_warp_relative(wmWindow *win, int x, int y)
 bool wm_cursor_arrow_move(wmWindow *win, const wmEvent *event)
 {
   if (win && event->val == KM_PRESS) {
+    /* Must move at least this much to avoid rounding in WM_cursor_warp. */
+    float fac = GHOST_GetNativePixelSize(win->ghostwin);
+
     if (event->type == UPARROWKEY) {
-      wm_cursor_warp_relative(win, 0, 1);
+      wm_cursor_warp_relative(win, 0, fac);
       return 1;
     }
     else if (event->type == DOWNARROWKEY) {
-      wm_cursor_warp_relative(win, 0, -1);
+      wm_cursor_warp_relative(win, 0, -fac);
       return 1;
     }
     else if (event->type == LEFTARROWKEY) {
-      wm_cursor_warp_relative(win, -1, 0);
+      wm_cursor_warp_relative(win, -fac, 0);
       return 1;
     }
     else if (event->type == RIGHTARROWKEY) {
-      wm_cursor_warp_relative(win, 1, 0);
+      wm_cursor_warp_relative(win, fac, 0);
       return 1;
     }
   }



More information about the Bf-blender-cvs mailing list