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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-09-08 16:35:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-09-08 16:39:37 +0300
commita93e15aee37cad718fc2a2a53606bc2a35d60802 (patch)
treed7bee3b383e054ed37e84e2d4ac22cddb524cf8b /source/blender/windowmanager/intern/wm_window.c
parent9d8aaf77ac2e43c29c4f9f8ef633b8b0e78bd1ea (diff)
Fix T45771: Walk mode fails on OSX
Diffstat (limited to 'source/blender/windowmanager/intern/wm_window.c')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c12
1 files changed, 12 insertions, 0 deletions
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
@@ -1557,6 +1557,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
*/
float WM_cursor_pressure(const struct wmWindow *win)