From: Emden R. Gansner Date: Wed, 7 May 2014 15:35:52 +0000 (-0400) Subject: Use real root to check if labels exist, as this is where the bits are set. X-Git-Tag: TRAVIS_CI_BUILD_EXPERIMENTAL~216^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2735ba581e9b62ed9164dcc00b68e145c15b45d8;p=graphviz Use real root to check if labels exist, as this is where the bits are set. --- diff --git a/lib/dotgen/dotsplines.c b/lib/dotgen/dotsplines.c index 11e9e9651..1fc615730 100644 --- a/lib/dotgen/dotsplines.c +++ b/lib/dotgen/dotsplines.c @@ -266,7 +266,7 @@ static void _dot_splines(graph_t * g, int normalize) if (et == ET_NONE) return; if (et == ET_CURVED) { resetRW (g); - if (GD_has_labels(g) & EDGE_LABEL) { + if (GD_has_labels(g->root) & EDGE_LABEL) { agerr (AGWARN, "edge labels with splines=curved not supported in dot - use xlabels\n"); } for (n = agfstnode (g); n; n = agnxtnode(g, n)) { @@ -279,7 +279,7 @@ static void _dot_splines(graph_t * g, int normalize) #ifdef ORTHO if (et == ET_ORTHO) { resetRW (g); - if (GD_has_labels(g) & EDGE_LABEL) { + if (GD_has_labels(g->root) & EDGE_LABEL) { setEdgeLabelPos (g); orthoEdges (g, 1); } @@ -1558,7 +1558,7 @@ make_flat_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind r = ND_rank(tn); if (r > 0) { rank_t* prevr; - if (GD_has_labels(g) & EDGE_LABEL) + if (GD_has_labels(g->root) & EDGE_LABEL) prevr = GD_rank(g) + (r-2); else prevr = GD_rank(g) + (r-1); @@ -1654,7 +1654,7 @@ makeLineEdge(graph_t* g, edge_t* fe, pointf* points, node_t** hp) hn = aghead(e); tn = agtail(e); delr = ABS(ND_rank(hn)-ND_rank(tn)); - if ((delr == 1) || ((delr == 2) && (GD_has_labels(g) & EDGE_LABEL))) + if ((delr == 1) || ((delr == 2) && (GD_has_labels(g->root) & EDGE_LABEL))) return 0; if (agtail(fe) == agtail(e)) { *hp = hn; @@ -1796,7 +1796,7 @@ make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int boxes[boxn++] = rank_box(sp, g, ND_rank(tn)); if (!smode && ((sl = straight_len(hn)) >= - ((GD_has_labels(g) & EDGE_LABEL) ? 4 + 1 : 2 + 1))) { + ((GD_has_labels(g->root) & EDGE_LABEL) ? 4 + 1 : 2 + 1))) { smode = TRUE; si = 1, sl -= 2; } diff --git a/lib/dotgen/position.c b/lib/dotgen/position.c index b81cd8762..987242b0b 100644 --- a/lib/dotgen/position.c +++ b/lib/dotgen/position.c @@ -222,7 +222,7 @@ make_LR_constraints(graph_t * g) rank_t *rank = GD_rank(g); /* Use smaller separation on odd ranks if g has edge labels */ - if (GD_has_labels(g) & EDGE_LABEL) { + if (GD_has_labels(g->root) & EDGE_LABEL) { sep[0] = GD_nodesep(g); sep[1] = 5; } diff --git a/lib/dotgen/rank.c b/lib/dotgen/rank.c index 042612b26..4f32f1a62 100644 --- a/lib/dotgen/rank.c +++ b/lib/dotgen/rank.c @@ -96,7 +96,7 @@ edgelabel_ranks(graph_t * g) node_t *n; edge_t *e; - if (GD_has_labels(g) & EDGE_LABEL) { + if (GD_has_labels(g->root) & EDGE_LABEL) { for (n = agfstnode(g); n; n = agnxtnode(g, n)) for (e = agfstout(g, n); e; e = agnxtout(g, e)) ED_minlen(e) *= 2;