diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-30 21:54:36 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-30 21:54:36 +0300 |
commit | e1700aa6c94d34b6e96571506207d660686d6003 (patch) | |
tree | 0fe7b221956d543b16023e9de631ff1b4ff4a90f /source/blender/editors/space_view3d | |
parent | f7b7d7952d5edc22e717ab20a96f77cb3c1be87b (diff) |
[#20320] Quad View - Orthogonal grid changes to perspective grid
- respect view locking (dont change rv3d->view)
- on multiple calls to smoothview, get the original view from the previously called smoothview if it exists.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index a83d226ae79..c4f5f37c5e5 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -282,9 +282,12 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo sms.orig_lens= v3d->lens; } /* grid draw as floor */ - sms.orig_view= rv3d->view; - rv3d->view= 0; - + if((rv3d->viewlock & RV3D_LOCKED)==0) { + /* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */ + sms.orig_view= rv3d->sms ? rv3d->sms->orig_view : rv3d->view; + rv3d->view= 0; + } + /* ensure it shows correct */ if(sms.to_camera) rv3d->persp= RV3D_PERSP; @@ -344,8 +347,11 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *op, wmEvent *event) rv3d->dist = sms->new_dist; v3d->lens = sms->new_lens; } - rv3d->view= sms->orig_view; + if((rv3d->viewlock & RV3D_LOCKED)==0) { + rv3d->view= sms->orig_view; + } + MEM_freeN(rv3d->sms); rv3d->sms= NULL; |