View3D: apply smoothview before modal view operations

This commit is contained in:
Campbell Barton 2016-05-05 02:01:18 +10:00
parent bd1378b56b
commit 6601680e8d
1 changed files with 14 additions and 0 deletions

View File

@ -1229,6 +1229,8 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_PASS_THROUGH;
}
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->ar);
/* switch from camera view when: */
if (view3d_ensure_persp(vod->v3d, vod->ar)) {
/* If we're switching from camera view to the perspective one,
@ -1648,6 +1650,8 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event)
viewops_data_create_ex(C, op, event,
(U.uiflag & USER_ORBIT_SELECTION) != 0, false);
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->ar);
vod = op->customdata;
v3d = vod->v3d;
rv3d = vod->rv3d;
@ -1714,6 +1718,8 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev
viewops_data_create_ex(C, op, event,
(U.uiflag & USER_ORBIT_SELECTION) != 0, false);
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->ar);
vod = op->customdata;
v3d = vod->v3d;
rv3d = vod->rv3d;
@ -2024,6 +2030,8 @@ static int viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event)
viewops_data_create(C, op, event);
vod = op->customdata;
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->ar);
if (event->type == MOUSEPAN) {
/* invert it, trackpad scroll follows same principle as 2d windows this way */
viewmove_apply(vod, 2 * event->x - event->prevx, 2 * event->y - event->prevy);
@ -2503,6 +2511,8 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, const wmEvent *event)
viewops_data_create(C, op, event);
vod = op->customdata;
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->ar);
/* if one or the other zoom position aren't set, set from event */
if (!RNA_struct_property_is_set(op->ptr, "mx") || !RNA_struct_property_is_set(op->ptr, "my")) {
RNA_int_set(op->ptr, "mx", event->x);
@ -2743,6 +2753,8 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_PASS_THROUGH;
}
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->ar);
/* needs to run before 'viewops_data_create' so the backup 'rv3d->ofs' is correct */
/* switch from camera view when: */
if (vod->rv3d->persp != RV3D_PERSP) {
@ -4260,6 +4272,8 @@ static int viewroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
viewops_data_create(C, op, event);
vod = op->customdata;
ED_view3d_smooth_view_force_finish(C, vod->v3d, vod->ar);
/* overwrite the mouse vector with the view direction */
normalize_v3_v3(vod->mousevec, vod->rv3d->viewinv[2]);
negate_v3(vod->mousevec);