diff options
Diffstat (limited to 'source/blender/editors/interface/view2d_ops.c')
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index fa2c1f25cfc..b271b0b5bc6 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1223,7 +1223,6 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op) View2D *v2d = &ar->v2d; rctf rect; rctf cur_new = v2d->cur; - int gesture_mode; const int smooth_viewtx = WM_operator_smooth_viewtx_get(op); /* convert coordinates of rect to 'tot' rect coordinates */ @@ -1231,9 +1230,9 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op) UI_view2d_region_to_view_rctf(v2d, &rect, &rect); /* check if zooming in/out view */ - gesture_mode = RNA_int_get(op->ptr, "gesture_mode"); + const bool zoom_in = !RNA_boolean_get(op->ptr, "zoom_out"); - if (gesture_mode == GESTURE_MODAL_IN) { + if (zoom_in) { /* zoom in: * - 'cur' rect will be defined by the coordinates of the border region * - just set the 'cur' rect to have the same coordinates as the border region @@ -1248,8 +1247,7 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op) cur_new.ymax = rect.ymax; } } - else { /* if (gesture_mode == GESTURE_MODAL_OUT) */ - + else { /* zoom out: * - the current 'cur' rect coordinates are going to end up where the 'rect' ones are, * but the 'cur' rect coordinates will need to be adjusted to take in more of the view @@ -1289,15 +1287,15 @@ static void VIEW2D_OT_zoom_border(wmOperatorType *ot) ot->idname = "VIEW2D_OT_zoom_border"; /* api callbacks */ - ot->invoke = WM_border_select_invoke; + ot->invoke = WM_gesture_border_invoke; ot->exec = view_borderzoom_exec; - ot->modal = WM_border_select_modal; - ot->cancel = WM_border_select_cancel; + ot->modal = WM_gesture_border_modal; + ot->cancel = WM_gesture_border_cancel; ot->poll = view_zoom_poll; /* rna */ - WM_operator_properties_gesture_border(ot, false); + WM_operator_properties_gesture_border_zoom(ot); } #ifdef WITH_INPUT_NDOF @@ -1545,7 +1543,7 @@ static void VIEW2D_OT_smoothview(wmOperatorType *ot) ot->flag = OPTYPE_INTERNAL; /* rna */ - WM_operator_properties_gesture_border(ot, false); + WM_operator_properties_gesture_border(ot); } /* ********************************************************* */ |