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/editors/space_view3d/view3d_walk.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/blender/editors/space_view3d/view3d_walk.c') diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index e2fbbf58a5c..8bb102085b1 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -62,6 +62,9 @@ #define USE_TABLET_SUPPORT +/* ensure the target position is one we can reach, see: T45771 */ +#define USE_PIXELSIZE_NATIVE_SUPPORT + /* prototypes */ static float getVelocityZeroTime(const float gravity, const float velocity); @@ -578,6 +581,16 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op) walk->center_mval[0] = walk->ar->winx * 0.5f; walk->center_mval[1] = walk->ar->winy * 0.5f; +#ifdef USE_PIXELSIZE_NATIVE_SUPPORT + walk->center_mval[0] += walk->ar->winrct.xmin; + walk->center_mval[1] += walk->ar->winrct.ymin; + + WM_cursor_comaptible_xy(win, &walk->center_mval[0], &walk->center_mval[1]); + + walk->center_mval[0] -= walk->ar->winrct.xmin; + walk->center_mval[1] -= walk->ar->winrct.ymin; +#endif + copy_v2_v2_int(walk->prev_mval, walk->center_mval); WM_cursor_warp(win, -- cgit v1.2.3