diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-01-23 03:24:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-01-23 03:24:44 +0300 |
commit | 367e61117907bb7507935251ecb7e396a4c91cbc (patch) | |
tree | b9b7b6c4582982f5538e8d88836432bd8ff442f0 /source/blender/editors/space_view3d/view3d_draw.c | |
parent | fb8c382fa17fb0b49cc0f5fae168e7b14bc3aa63 (diff) | |
parent | fb4582134ae1ebedc68f3c4a4bf2f196503e142c (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index cf43d65b44a..f734bb085d0 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -133,11 +133,18 @@ void ED_view3d_update_viewmat( view3d_winmatrix_set(depsgraph, ar, v3d, rect); /* setup view matrix */ - if (viewmat) + if (viewmat) { copy_m4_m4(rv3d->viewmat, viewmat); - else - view3d_viewmatrix_set(eval_ctx, 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; + } + /* note: calls BKE_object_where_is_calc for camera... */ + view3d_viewmatrix_set(eval_ctx, scene, v3d, rv3d, rect ? rect_scale : NULL); + } /* update utility matrices */ mul_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat); invert_m4_m4(rv3d->persinv, rv3d->persmat); |