From: Emden R. Gansner Date: Tue, 4 Mar 2014 14:40:19 +0000 (-0500) Subject: Fix gvpr so that edges can be created in subgraphs X-Git-Tag: 2.38.0~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b83f47fd82cdbb1c4b7349329212697e515e971;p=graphviz Fix gvpr so that edges can be created in subgraphs --- diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index 68f7851ad..f8cb70bec 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -2613,19 +2613,19 @@ Agnode_t *openNode(Agraph_t * g, char *name) /* openEdge: * Create edge and initialize dynamic data. - * The edge is always created in the root graph. */ Agedge_t *openEdge(Agraph_t* g, Agnode_t * t, Agnode_t * h, char *key) { Agedge_t *ep; Agraph_t *root; - root = sameG(t, h, "openEdge", "tail and head node"); + root = sameG(t, h, "openEdge", "tail and head nodes"); if (!root) return 0; - if (g && (root != agroot(g))) - return 0; - else + if (g) { + if (!sameG(g, root, "openEdge", "subgraph and nodes")) + return 0; + } else g = root; ep = agedge(g, t, h, key, 1);