From 8d8d113b7379b96d8cd9440f4e1f87524a418fef Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Mar 2019 22:26:45 +1100 Subject: Tool System: use set/add/subtract for all circle select operators This applies changes from the 3D view circle select to other operators. --- source/blender/editors/space_graph/graph_select.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_graph/graph_select.c') diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 85afd70e083..3c3bd760a72 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -505,8 +505,6 @@ void GRAPH_OT_select_lasso(wmOperatorType *ot) static int graph_circle_select_exec(bContext *C, wmOperator *op) { bAnimContext ac; - const bool select = !RNA_boolean_get(op->ptr, "deselect"); - const short selectmode = select ? SELECT_ADD : SELECT_SUBTRACT; bool incl_handles = false; KeyframeEdit_CircleData data = {0}; @@ -520,6 +518,13 @@ static int graph_circle_select_exec(bContext *C, wmOperator *op) if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; + const eSelectOp sel_op = ED_select_op_modal( + RNA_enum_get(op->ptr, "mode"), WM_gesture_is_modal_first(op->customdata)); + const short selectmode = (sel_op != SEL_OP_SUB) ? SELECT_ADD : SELECT_SUBTRACT; + if (SEL_OP_USE_PRE_DESELECT(sel_op)) { + deselect_graph_keys(&ac, 0, SELECT_SUBTRACT, true); + } + data.mval[0] = x; data.mval[1] = y; data.radius_squared = radius * radius; @@ -566,7 +571,8 @@ void GRAPH_OT_select_circle(wmOperatorType *ot) ot->flag = OPTYPE_UNDO; /* properties */ - WM_operator_properties_gesture_circle_select(ot); + WM_operator_properties_gesture_circle(ot); + WM_operator_properties_select_operation_simple(ot); } /* ******************** Column Select Operator **************************** */ -- cgit v1.2.3