diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-22 12:11:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-22 12:14:12 +0300 |
commit | fb4582134ae1ebedc68f3c4a4bf2f196503e142c (patch) | |
tree | 4bebded2ca5a4da3cbc8d41b0ebc41a0a144e99d /source/blender/editors/space_view3d/view3d_draw.c | |
parent | c723e91ee155612b68950ca2a44b49bdd3c72838 (diff) |
Fix T53850: Lock to Cursor breaks 3D manipulators
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 694434d87e8..1bf33441169 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2751,10 +2751,17 @@ void ED_view3d_update_viewmat( view3d_winmatrix_set(ar, v3d, rect); /* setup view matrix */ - if (viewmat) + if (viewmat) { copy_m4_m4(rv3d->viewmat, viewmat); - else - view3d_viewmatrix_set(scene, v3d, rv3d); /* note: calls BKE_object_where_is_calc for camera... */ + } + else { + float rect_scale[2]; + if (rect) { + rect_scale[0] = (float)BLI_rcti_size_x(rect) / (float)ar->winx; + rect_scale[1] = (float)BLI_rcti_size_y(rect) / (float)ar->winy; + } + view3d_viewmatrix_set(scene, v3d, rv3d, rect ? rect_scale : NULL); /* note: calls BKE_object_where_is_calc for camera... */ + } /* update utility matrices */ mul_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat); |