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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-11-07 13:02:30 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-11-07 13:02:30 +0400
commit81184c61734e16286f48b57ee9d5f32ade5eb5ad (patch)
tree0c6553c654e6b553a05ce1f1919d6d8067631ca1 /source/blender/editors
parent9708f7921d3c865107f371349dc2a6726775f92c (diff)
Fix for node link highlighting not getting reset if a transform operator is cancelled and the node removed. Pass the 'test' option in node link insert testing on to the conditions function, so that at least the highlight flags get cleared before exiting the link insert function, even if there is no actual selected node to insert.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_node/node_relationships.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 23ecb87151b..9f5e8a6f9d9 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -1173,7 +1173,7 @@ void NODE_OT_detach(wmOperatorType *ot)
/* prevent duplicate testing code below */
-static bool ed_node_link_conditions(ScrArea *sa, SpaceNode **r_snode, bNode **r_select)
+static bool ed_node_link_conditions(ScrArea *sa, bool test, SpaceNode **r_snode, bNode **r_select)
{
SpaceNode *snode = sa ? sa->spacedata.first : NULL;
bNode *node, *select = NULL;
@@ -1186,6 +1186,11 @@ static bool ed_node_link_conditions(ScrArea *sa, SpaceNode **r_snode, bNode **r_
if (sa == NULL || sa->spacetype != SPACE_NODE)
return false;
+ if (!test) {
+ /* no need to look for a node */
+ return true;
+ }
+
for (node = snode->edittree->nodes.first; node; node = node->next) {
if (node->flag & SELECT) {
if (select)
@@ -1223,7 +1228,7 @@ void ED_node_link_intersect_test(ScrArea *sa, int test)
bNodeLink *link, *selink = NULL;
float mcoords[6][2];
- if (!ed_node_link_conditions(sa, &snode, &select)) return;
+ if (!ed_node_link_conditions(sa, test, &snode, &select)) return;
/* clear flags */
for (link = snode->edittree->links.first; link; link = link->next)
@@ -1302,7 +1307,7 @@ void ED_node_link_insert(ScrArea *sa)
bNodeLink *link;
bNodeSocket *sockto;
- if (!ed_node_link_conditions(sa, &snode, &select)) return;
+ if (!ed_node_link_conditions(sa, true, &snode, &select)) return;
/* get the link */
for (link = snode->edittree->links.first; link; link = link->next)