diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-07 12:16:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-07 13:20:57 +0300 |
commit | a452fcb9a5495ecbbbaedb7e5c631814c7f4372a (patch) | |
tree | 078a29e0559bbbd67921690b082241f5cb9c9cf7 /source/blender/editors/space_view3d/view3d_edit.c | |
parent | 19a0df25e36d9e75d486e8c51ccb874095a93e91 (diff) |
View3D: take clipping into account for Frame All
Clamp the min/max used for Frame All/Selected
by the clipping region if it's set.
Resolve T81050
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 897777c9159..c16cd94d90d 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2978,6 +2978,11 @@ static int view3d_all_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } + if (RV3D_CLIPPING_ENABLED(v3d, rv3d)) { + /* This is an approximation, see function documentation for details. */ + ED_view3d_clipping_clamp_minmax(rv3d, min, max); + } + if (use_all_regions) { view3d_from_minmax_multi(C, v3d, min, max, true, smooth_viewtx); } @@ -3125,6 +3130,11 @@ static int viewselected_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } + if (RV3D_CLIPPING_ENABLED(v3d, rv3d)) { + /* This is an approximation, see function documentation for details. */ + ED_view3d_clipping_clamp_minmax(rv3d, min, max); + } + if (use_all_regions) { view3d_from_minmax_multi(C, v3d, min, max, ok_dist, smooth_viewtx); } |