diff options
Diffstat (limited to 'source/blender/editors/mask/mask_ops.c')
-rw-r--r-- | source/blender/editors/mask/mask_ops.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index eef03852007..97d5ee1eff0 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -889,7 +889,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) if (ELEM(event->type, LEFTSHIFTKEY, RIGHTSHIFTKEY)) data->is_accurate = (event->val == KM_PRESS); - /* fall-through */ /* update CV position */ + ATTR_FALLTHROUGH; /* update CV position */ case MOUSEMOVE: { ScrArea *sa = CTX_wm_area(C); @@ -999,7 +999,7 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) if (weight) { sub_v2_v2v2(c, offco, p); - project_v2_v2v2(vec, c, no); + project_v2_v2v2_normalized(vec, c, no); w = len_v2(vec); @@ -1376,7 +1376,7 @@ static int slide_spline_curvature_modal(bContext *C, wmOperator *op, const wmEve } - /* fall-through */ /* update CV position */ + ATTR_FALLTHROUGH; /* update CV position */ case MOUSEMOVE: { float B[2], mouse_coord[2], delta[2]; @@ -1909,7 +1909,7 @@ static int set_handle_type_exec(bContext *C, wmOperator *op) void MASK_OT_handle_type_set(wmOperatorType *ot) { - static EnumPropertyItem editcurve_handle_type_items[] = { + static const EnumPropertyItem editcurve_handle_type_items[] = { {HD_AUTO, "AUTO", 0, "Auto", ""}, {HD_VECT, "VECTOR", 0, "Vector", ""}, {HD_ALIGN, "ALIGNED", 0, "Aligned Single", ""}, @@ -1937,16 +1937,17 @@ void MASK_OT_handle_type_set(wmOperatorType *ot) /* ********* clear/set restrict view *********/ -static int mask_hide_view_clear_exec(bContext *C, wmOperator *UNUSED(op)) +static int mask_hide_view_clear_exec(bContext *C, wmOperator *op) { Mask *mask = CTX_data_edit_mask(C); MaskLayer *masklay; bool changed = false; + const bool select = RNA_boolean_get(op->ptr, "select"); for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { if (masklay->restrictflag & OB_RESTRICT_VIEW) { - ED_mask_layer_select_set(masklay, true); + ED_mask_layer_select_set(masklay, select); masklay->restrictflag &= ~OB_RESTRICT_VIEW; changed = true; } @@ -1977,6 +1978,8 @@ void MASK_OT_hide_view_clear(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "select", true, "Select", ""); } static int mask_hide_view_set_exec(bContext *C, wmOperator *op) @@ -2151,7 +2154,7 @@ static int mask_layer_move_exec(bContext *C, wmOperator *op) void MASK_OT_layer_move(wmOperatorType *ot) { - static EnumPropertyItem direction_items[] = { + static const EnumPropertyItem direction_items[] = { {-1, "UP", 0, "Up", ""}, {1, "DOWN", 0, "Down", ""}, {0, NULL, 0, NULL, NULL} |