Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-15 11:48:21 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-02-15 15:44:20 +0300
commitff4ffb18d420852cb20c4c9bb75b6f50277bfcac (patch)
treed5075e5f1b03ee21621d0f5994bb542eed6b01f8 /source
parent6669eca820f5295204a9b0fe5cf19e1ce15ac792 (diff)
Fix T67924: transform right/up arrow keys not working on macOS
Diffstat (limited to 'source')
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c11
1 files changed, 7 insertions, 4 deletions
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;
}
}