From: Emden R. Gansner Date: Tue, 4 Mar 2014 16:20:30 +0000 (-0500) Subject: Fix bug in gv.cpp: could not create edge in subgraph X-Git-Tag: 2.38.0~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c53425d1516cbfbd12030b9652b4a7ad5c2cee1;p=graphviz Fix bug in gv.cpp: could not create edge in subgraph --- diff --git a/tclpkg/gv/gv.cpp b/tclpkg/gv/gv.cpp index 23e13568c..f2d9669b9 100644 --- a/tclpkg/gv/gv.cpp +++ b/tclpkg/gv/gv.cpp @@ -107,14 +107,19 @@ Agnode_t *node(Agraph_t *g, char *name) return agnode(g, name, 1); } -Agedge_t *edge(Agnode_t *t, Agnode_t *h) +Agedge_t *edge(Agraph_t* g, Agnode_t *t, Agnode_t *h) { - if (!gvc || !t || !h) + if (!gvc || !t || !h || !g) return NULL; // edges from/to the protonode are not permitted if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH) return NULL; - return agedge(agraphof(t), t, h, NULL, 1); + return agedge(g, t, h, NULL, 1); +} + +Agedge_t *edge(Agnode_t *t, Agnode_t *h) +{ + return edge(agraphof(t), t, h); } // induce tail if necessary @@ -132,7 +137,7 @@ Agedge_t *edge(Agnode_t *t, char *hname) // induce tail/head if necessary Agedge_t *edge(Agraph_t *g, char *tname, char *hname) { - return edge(node(g, tname), node(g, hname)); + return edge(g, node(g, tname), node(g, hname)); } //-------------------------------------------------