From a93e15aee37cad718fc2a2a53606bc2a35d60802 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 8 Sep 2015 23:35:49 +1000 Subject: Fix T45771: Walk mode fails on OSX --- source/blender/windowmanager/intern/wm_window.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/windowmanager/intern/wm_window.c') diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index af7e9c8ca33..c2209b2fe7c 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1556,6 +1556,18 @@ void WM_cursor_warp(wmWindow *win, int x, int y) } } +/** + * Set x, y to values we can actually position the cursor to. + */ +void WM_cursor_comaptible_xy(wmWindow *win, int *x, int *y) +{ + float f = GHOST_GetNativePixelSize(win->ghostwin); + if (f != 1.0f) { + *x = (int)(*x / f) * f; + *y = (int)(*y / f) * f; + } +} + /** * Get the cursor pressure, in most cases you'll want to use wmTabletData from the event */ -- cgit v1.2.3