diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-07 12:33:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-07 12:34:10 +0300 |
commit | 219e2f976d077c16c28d72a2f6763c01230c5bf8 (patch) | |
tree | ba40e7f79947dd11cae4a08ed813f920c00fbfd7 /source/blender/editors/space_nla/nla_select.c | |
parent | e52e0c83d717b46afcce36b23e3f6b32f5cb535b (diff) |
Tool System: use set/add/subtract for all box select operators
Diffstat (limited to 'source/blender/editors/space_nla/nla_select.c')
-rw-r--r-- | source/blender/editors/space_nla/nla_select.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 0c9cd069265..f326637f1cd 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -284,29 +284,21 @@ static int nlaedit_box_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; rcti rect; - short mode = 0, selectmode = 0; - const bool select = !RNA_boolean_get(op->ptr, "deselect"); - const bool extend = RNA_boolean_get(op->ptr, "extend"); + short mode = 0; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - /* clear all selection if not extending selection */ - if (!extend) { + const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode"); + const int selectmode = (sel_op != SEL_OP_SUB) ? SELECT_ADD : SELECT_SUBTRACT; + if (SEL_OP_USE_PRE_DESELECT(sel_op)) { deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_SUBTRACT); } /* get settings from operator */ WM_operator_properties_border_to_rcti(op, &rect); - if (select) { - selectmode = SELECT_ADD; - } - else { - selectmode = SELECT_SUBTRACT; - } - /* selection 'mode' depends on whether box_select region only matters on one axis */ if (RNA_boolean_get(op->ptr, "axis_range")) { /* mode depends on which axis of the range is larger to determine which axis to use @@ -349,10 +341,11 @@ void NLA_OT_select_box(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - /* rna */ - WM_operator_properties_gesture_box_select(ot); - + /* properties */ RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", ""); + + WM_operator_properties_gesture_box(ot); + WM_operator_properties_select_operation_simple(ot); } /* ******************** Select Left/Right Operator ************************* */ |