From: ellson Date: Tue, 18 Oct 2005 18:41:53 +0000 (+0000) Subject: Fix bugs introduced into gvpack from recent changes to the main library. X-Git-Tag: LAST_LIBGRAPH~32^2~7288 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=164ea152f04974eeaee34865a274626c64bd6cc0;p=graphviz Fix bugs introduced into gvpack from recent changes to the main library. The node width and height are generated from ND_rw_i, ND_ht_i, and ND_lw_i. The old version of gvpack just worked by accident. Also, init_graph resets the layout State, so gvpack must reset it after the call to init_graph. --- diff --git a/cmd/tools/gvpack.c b/cmd/tools/gvpack.c index 021a4ed69..ddbe96868 100644 --- a/cmd/tools/gvpack.c +++ b/cmd/tools/gvpack.c @@ -298,7 +298,10 @@ static void cloneNode(Agnode_t * old, Agnode_t * new) ND_coord_i(new).x = POINTS(ND_pos(old)[0]); ND_coord_i(new).y = POINTS(ND_pos(old)[1]); ND_height(new) = ND_height(old); + ND_ht_i(new) = ND_ht_i(old); ND_width(new) = ND_width(old); + ND_lw_i(new) = ND_lw_i(old); + ND_rw_i(new) = ND_rw_i(old); ND_shape(new) = ND_shape(old); ND_shape_info(new) = ND_shape_info(old); } @@ -601,6 +604,7 @@ static Agraph_t *cloneGraph(Agraph_t ** gs, int cnt) /* do common initialization. This will handle root's label. */ init_graph(root, FALSE); + State = GVSPLINES; gnames = dtopen(&pairdisc, Dtoset); nnames = dtopen(&pairdisc, Dtoset); @@ -671,7 +675,6 @@ static Agraph_t **readGraphs(int *cp) /* set various state values */ PSinputscale = POINTS_PER_INCH; Nop = 2; - State = GVSPLINES; newIngraph(&ig, myFiles, agread); while ((g = nextGraph(&ig)) != 0) {