diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-06-24 14:49:22 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-06-24 14:49:22 +0400 |
commit | 785a5c3aab0c92fa1286118df87db8e99b5769b4 (patch) | |
tree | 2da8651720e1569437aa477ac1512d1df370083b /source/blender/editors/space_node/drawnode.c | |
parent | d71d41755efa526b55f1196618e4dc0f03988d07 (diff) |
Fix #31908, better drawing for node group interface links. Links from/to node group internal sockets (input/output columns on the side) were drawn in a kind of subtle "background" mode, making them hard to see behind nodes. This was still from pre-2.56.2 versions, where group interfaces were created automatically and these links were just indicators of which external socket a node refers to.
Now these links are drawn in the same way as all others. Also they now display highlighting correctly when inserting a node into a link, making it easier to avoid unwanted insertions.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 22017a2d8b9..c5f237a0420 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3316,37 +3316,34 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) do_triple = TRUE; } else { + int cycle = 0; + /* going to give issues once... */ if (link->tosock->flag & SOCK_UNAVAIL) return; if (link->fromsock->flag & SOCK_UNAVAIL) return; - /* a bit ugly... but thats how we detect the internal group links */ - if (!link->fromnode || !link->tonode) { - UI_ThemeColorBlend(TH_BACK, TH_WIRE, 0.5f); - do_shaded = FALSE; - } - else { - /* check cyclic */ - if ((link->fromnode->level >= link->tonode->level && link->tonode->level != 0xFFF) && (link->flag & NODE_LINK_VALID)) { - /* special indicated link, on drop-node */ - if (link->flag & NODE_LINKFLAG_HILITE) { - th_col1 = th_col2 = TH_ACTIVE; - } - else { - /* regular link */ - if (link->fromnode->flag & SELECT) - th_col1 = TH_EDGE_SELECT; - if (link->tonode->flag & SELECT) - th_col2 = TH_EDGE_SELECT; - } - do_shaded = TRUE; - do_triple = TRUE; - } + /* check cyclic */ + if (link->fromnode && link->tonode) + cycle = (link->fromnode->level < link->tonode->level || link->tonode->level == 0xFFF); + if (!cycle && (link->flag & NODE_LINK_VALID)) { + /* special indicated link, on drop-node */ + if (link->flag & NODE_LINKFLAG_HILITE) { + th_col1 = th_col2 = TH_ACTIVE; + } else { - th_col1 = TH_REDALERT; + /* regular link */ + if (link->fromnode && link->fromnode->flag & SELECT) + th_col1 = TH_EDGE_SELECT; + if (link->tonode && link->tonode->flag & SELECT) + th_col2 = TH_EDGE_SELECT; } + do_shaded = TRUE; + do_triple = TRUE; + } + else { + th_col1 = TH_REDALERT; } } |