From 219e2f976d077c16c28d72a2f6763c01230c5bf8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 7 Mar 2019 20:33:57 +1100 Subject: Tool System: use set/add/subtract for all box select operators --- source/blender/editors/space_outliner/outliner_select.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 1f59658b8ab..09fa6d63557 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1262,14 +1262,18 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); SpaceOutliner *soops = CTX_wm_space_outliner(C); ARegion *ar = CTX_wm_region(C); - TreeElement *te; rctf rectf; - bool select = !RNA_boolean_get(op->ptr, "deselect"); + + const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode"); + const bool select = (sel_op != SEL_OP_SUB); + if (SEL_OP_USE_PRE_DESELECT(sel_op)) { + outliner_flag_set(&soops->tree, TSE_SELECTED, 0); + } WM_operator_properties_border_to_rctf(op, &rectf); UI_view2d_region_to_view_rctf(&ar->v2d, &rectf, &rectf); - for (te = soops->tree.first; te; te = te->next) { + for (TreeElement *te = soops->tree.first; te; te = te->next) { outliner_item_box_select(soops, scene, &rectf, te, select); } @@ -1298,8 +1302,9 @@ void OUTLINER_OT_select_box(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - /* rna */ - WM_operator_properties_gesture_box_ex(ot, true, false); + /* properties */ + WM_operator_properties_gesture_box(ot); + WM_operator_properties_select_operation_simple(ot); } /* ****************************************************** */ -- cgit v1.2.3