diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2018-05-13 10:37:53 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2018-05-24 09:34:31 +0300 |
commit | 54f2e58452bba1db8c50d26ca6999473fa45809d (patch) | |
tree | 07a6fba3a9451f3158bce0c2f9c7b900fca252eb /source/blender/editors | |
parent | 176e18436c45e38a2b7f1e7fccfdc0abedc1c13d (diff) |
Fix T54336: Extend property of Lasso select tool in Node editor does not
work
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D3360
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); |