From: Emden Gansner Date: Fri, 14 Oct 2011 19:54:56 +0000 (-0400) Subject: Fix cgraph code in dot related to virtual nodes. In particular, avoid calling agsubno... X-Git-Tag: LAST_LIBGRAPH~32^2~630^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7edd0a4f603f024d6dc7c6608be8e9cd768f7965;p=graphviz Fix cgraph code in dot related to virtual nodes. In particular, avoid calling agsubnode on virtual node. --- diff --git a/lib/dotgen/cluster.c b/lib/dotgen/cluster.c index 1b49308f3..70343f4eb 100644 --- a/lib/dotgen/cluster.c +++ b/lib/dotgen/cluster.c @@ -286,10 +286,9 @@ merge_ranks(graph_t * subg) #ifndef WITH_CGRAPH v->graph = subg->root; #else /* WITH_CGRAPH */ -// agraphof(v) = agroot(subg); - agsubnode(subg, v, 1); - - + /* real nodes automatically have v->root = root graph */ + if (ND_node_type(v) == VIRTUAL) + v->root = root; #endif /* WITH_CGRAPH */ delete_fast_node(subg, v); fast_node(agroot(subg), v); diff --git a/lib/dotgen/fastgr.c b/lib/dotgen/fastgr.c index 2eb380fac..dd1e9c928 100644 --- a/lib/dotgen/fastgr.c +++ b/lib/dotgen/fastgr.c @@ -254,7 +254,6 @@ node_t *virtual_node(graph_t * g) #else /* WITH_CGRAPH */ // agnameof(n) = "virtual"; AGTYPE(n) = AGNODE; - n->root = g; n->base.data = NEW(Agnodeinfo_t); n->root = g; #endif /* WITH_CGRAPH */