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>2019-03-07 12:33:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-07 12:34:10 +0300
commit219e2f976d077c16c28d72a2f6763c01230c5bf8 (patch)
treeba40e7f79947dd11cae4a08ed813f920c00fbfd7 /source/blender/editors/space_graph/graph_select.c
parente52e0c83d717b46afcce36b23e3f6b32f5cb535b (diff)
Tool System: use set/add/subtract for all box select operators
Diffstat (limited to 'source/blender/editors/space_graph/graph_select.c')
-rw-r--r--source/blender/editors/space_graph/graph_select.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 3c3bd760a72..0ff36c407d7 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -339,31 +339,20 @@ static int graphkeys_box_select_exec(bContext *C, wmOperator *op)
bAnimContext ac;
rcti rect;
rctf rect_fl;
- short mode = 0, selectmode = 0;
- bool incl_handles;
- 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_graph_keys(&ac, 1, SELECT_SUBTRACT, true);
-
- /* get select mode
- * - 'include_handles' from the operator specifies whether to include handles in the selection
- */
- if (select) {
- selectmode = SELECT_ADD;
- }
- else {
- selectmode = SELECT_SUBTRACT;
}
- incl_handles = RNA_boolean_get(op->ptr, "include_handles");
+ /* 'include_handles' from the operator specifies whether to include handles in the selection. */
+ const bool incl_handles = RNA_boolean_get(op->ptr, "include_handles");
/* get settings from operator */
WM_operator_properties_border_to_rcti(op, &rect);
@@ -412,11 +401,12 @@ void GRAPH_OT_select_box(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- /* rna */
- WM_operator_properties_gesture_box_select(ot);
-
+ /* properties */
ot->prop = RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
RNA_def_boolean(ot->srna, "include_handles", 0, "Include Handles", "Are handles tested individually against the selection criteria");
+
+ WM_operator_properties_gesture_box(ot);
+ WM_operator_properties_select_operation_simple(ot);
}