diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_node/node_select.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 4b4add0e698..fcbd8156723 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -653,7 +653,7 @@ void NODE_OT_select_circle(wmOperatorType *ot) /* ****** Lasso Select ****** */ -static bool do_lasso_select_node(bContext *C, const int mcords[][2], short moves, short select) +static bool do_lasso_select_node(bContext *C, const int mcords[][2], short moves, bool select, bool extend) { SpaceNode *snode = CTX_wm_space_node(C); bNode *node; @@ -668,6 +668,11 @@ static bool do_lasso_select_node(bContext *C, const int mcords[][2], short moves /* do actual selection */ for (node = snode->edittree->nodes.first; node; node = node->next) { + + if (node->flag & NODE_SELECT && select && extend) { + continue; + } + int screen_co[2]; const float cent[2] = {BLI_rctf_cent_x(&node->totr), BLI_rctf_cent_y(&node->totr)}; @@ -680,6 +685,10 @@ static bool do_lasso_select_node(bContext *C, const int mcords[][2], short moves nodeSetSelected(node, select); changed = true; } + else if (select && !extend) { + nodeSetSelected(node, false); + changed = true; + } } if (changed) { @@ -695,10 +704,9 @@ static int node_lasso_select_exec(bContext *C, wmOperator *op) const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot); if (mcords) { - short select; - - select = !RNA_boolean_get(op->ptr, "deselect"); - do_lasso_select_node(C, mcords, mcords_tot, select); + const bool select = !RNA_boolean_get(op->ptr, "deselect"); + const bool extend = RNA_boolean_get(op->ptr, "extend"); + do_lasso_select_node(C, mcords, mcords_tot, select, extend); MEM_freeN((void *)mcords); |