From: erg Date: Fri, 15 Jul 2005 01:02:53 +0000 (+0000) Subject: Fix no longer correct use of GD_rankdir in dotsplines.c X-Git-Tag: LAST_LIBGRAPH~32^2~7436 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e18030b481036b62a12658d21de4f3cc85438867;p=graphviz Fix no longer correct use of GD_rankdir in dotsplines.c --- diff --git a/lib/common/input.c b/lib/common/input.c index 036bb3336..ab11b5822 100644 --- a/lib/common/input.c +++ b/lib/common/input.c @@ -506,9 +506,9 @@ void graph_init(graph_t * g, boolean use_rankdir) rankdir = RANKDIR_RL; } if (use_rankdir) - g->u.rankdir = (rankdir << 2) || rankdir; + SET_RANKDIR (g, (rankdir << 2) || rankdir); else - g->u.rankdir = (rankdir << 2); + SET_RANKDIR (g, (rankdir << 2)); xf = late_double(g, agfindattr(g, "nodesep"), DEFAULT_NODESEP, MIN_NODESEP); diff --git a/lib/common/macros.h b/lib/common/macros.h index 59776c8aa..d3ecaf8f9 100644 --- a/lib/common/macros.h +++ b/lib/common/macros.h @@ -113,6 +113,8 @@ #define HAS_CLUST_EDGE(g) (GD_flags(g) & 1) #define SET_CLUST_EDGE(g) (GD_flags(g) |= 1) +#define SET_RANKDIR(g,rd) ((g)->u.rankdir = (rd)) + #ifndef streq #define streq(a,b) (*(a)==*(b)&&!strcmp(a,b)) #endif diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index d592051ac..74de05262 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -637,9 +637,9 @@ cloneGraph (graph_t* g) GD_charset(auxg) = GD_charset (g); if (GD_flip(g)) - GD_rankdir(auxg) = RANKDIR_TB; + SET_RANKDIR(auxg, RANKDIR_TB); else - GD_rankdir(auxg) = RANKDIR_LR; + SET_RANKDIR(auxg, RANKDIR_LR); GD_nodesep(auxg) = GD_nodesep(g); GD_ranksep(auxg) = GD_ranksep(g);