diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-23 06:59:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-23 06:59:29 +0400 |
commit | af49b5f6c981f7759a22373848bf4e30015b8943 (patch) | |
tree | 0d665314bb808b10a3e2b321b5b1e9838415e9f4 /source | |
parent | b222863336a86e772bcf5d7e1007a72f6667d53b (diff) |
own recent commit broke zoom to mouseloc
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 9b451095c64..ecf110b98c9 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1112,22 +1112,14 @@ static void view_zoom_mouseloc(ARegion *ar, float dfac, int mx, int my) float tpos[3]; float mval_f[2]; float new_dist; - int vb[2], mouseloc[2]; - - mouseloc[0]= mx - ar->winrct.xmin; - mouseloc[1]= my - ar->winrct.ymin; - - /* find the current window width and height */ - vb[0] = ar->winx; - vb[1] = ar->winy; negate_v3_v3(tpos, rv3d->ofs); /* Project cursor position into 3D space */ initgrabz(rv3d, tpos[0], tpos[1], tpos[2]); - mval_f[0]= (mouseloc[0] - vb[0]) / 2.0f; - mval_f[1]= (mouseloc[1] - vb[1]) / 2.0f; + mval_f[0]= (float)(((mx - ar->winrct.xmin) * 2) - ar->winx) / 2.0f; + mval_f[1]= (float)(((my - ar->winrct.ymin) * 2) - ar->winy) / 2.0f; ED_view3d_win_to_delta(ar, mval_f, dvec); /* Calculate view target position for dolly */ |