Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-10-16 14:28:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-16 14:28:24 +0300
commita2758152e2dccb3b016e13a3de2d9e58587866ab (patch)
treed872a7ae82e682012758c12eb5d8c8e63828c00d /source/blender/editors/space_nla
parent14af3e485f1207e8f4ddb6991b22e1ba2f937c45 (diff)
parent870b4b673511094cf0beaeaf07305407ccdda47a (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r--source/blender/editors/space_nla/nla_select.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index 8261397c940..32eca3140fc 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -278,25 +278,28 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op)
bAnimContext ac;
rcti rect;
short mode = 0, selectmode = 0;
- int extend;
+ const bool select = !RNA_boolean_get(op->ptr, "deselect");
+ const bool extend = RNA_boolean_get(op->ptr, "extend");
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
/* clear all selection if not extending selection */
- extend = RNA_boolean_get(op->ptr, "extend");
- if (!extend)
+ if (!extend) {
deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_SUBTRACT);
+ }
/* get settings from operator */
WM_operator_properties_border_to_rcti(op, &rect);
-
- if (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT)
+
+ if (select) {
selectmode = SELECT_ADD;
- else
+ }
+ else {
selectmode = SELECT_SUBTRACT;
-
+ }
+
/* selection 'mode' depends on whether borderselect 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
@@ -329,10 +332,10 @@ void NLA_OT_select_border(wmOperatorType *ot)
ot->description = "Use box selection to grab NLA-Strips";
/* api callbacks */
- ot->invoke = WM_border_select_invoke;
+ ot->invoke = WM_gesture_border_invoke;
ot->exec = nlaedit_borderselect_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 = nlaop_poll_tweakmode_off;
@@ -340,7 +343,7 @@ void NLA_OT_select_border(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* rna */
- WM_operator_properties_gesture_border(ot, 1);
+ WM_operator_properties_gesture_border_select(ot);
RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
}