fix for [#20499] Smoot view doesn't work for all view keys.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 3 Jan 2010 03:01:46 +0000 (03:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 3 Jan 2010 03:01:46 +0000 (03:01 +0000)
source/blender/editors/space_view3d/view3d_edit.c

index 029bb84ca2f2547380222e88920bc2e5a97c57ee..c0d9d49d1883cc5a4cb128c2282bb40b6525ffba 100644 (file)
@@ -1836,9 +1836,8 @@ static EnumPropertyItem prop_view_orbit_items[] = {
 
 static int vieworbit_exec(bContext *C, wmOperator *op)
 {
-       ARegion *ar= CTX_wm_region(C);
        RegionView3D *rv3d= CTX_wm_region_view3d(C);
-       float phi, si, q1[4];
+       float phi, si, q1[4], new_quat[4];
        int orbitdir;
 
        orbitdir = RNA_enum_get(op->ptr, "type");
@@ -1854,10 +1853,10 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
                                q1[0]= (float)cos(phi);
                                q1[1]= q1[2]= 0.0;
                                q1[3]= si;
-                               mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, q1);
+                               mul_qt_qtqt(new_quat, rv3d->viewquat, q1);
                                rv3d->view= 0;
                        }
-                       if(orbitdir == V3D_VIEW_STEPDOWN || orbitdir == V3D_VIEW_STEPUP) {
+                       else if(orbitdir == V3D_VIEW_STEPDOWN || orbitdir == V3D_VIEW_STEPUP) {
                                /* horizontal axis */
                                VECCOPY(q1+1, rv3d->viewinv[0]);
 
@@ -1869,10 +1868,11 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
                                q1[1]*= si;
                                q1[2]*= si;
                                q1[3]*= si;
-                               mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, q1);
+                               mul_qt_qtqt(new_quat, rv3d->viewquat, q1);
                                rv3d->view= 0;
                        }
-                       ED_region_tag_redraw(ar);
+
+                       smooth_view(C, NULL, NULL, NULL, new_quat, NULL, NULL);
                }
        }