]> granicus.if.org Git - graphviz/commitdiff
Prevent exponential growth of length of edges in clusters
authorThadeus Fleming <thadeus.j.fleming@gmail.com>
Fri, 23 Mar 2018 15:42:25 +0000 (10:42 -0500)
committerThadeus Fleming <thadeus.j.fleming@gmail.com>
Fri, 23 Mar 2018 15:42:25 +0000 (10:42 -0500)
`edgelabel_ranks` gets called for the root graph and all of its cluster
subgraphs. It should only double `ED_minlen` for each edge once. Reverting the
test for labeled edges to check only the active graph, rather than its root,
prevents it from expanding the `minlen` once for every level of cluster
containing the edge.

Fixes #1246

lib/dotgen/rank.c

index 1c887b290383f65277fe27d209270c0e22ad092a..5808c0b5bc6c1fd97d458951fa412ab9a4dac06f 100644 (file)
@@ -96,7 +96,7 @@ edgelabel_ranks(graph_t * g)
     node_t *n;
     edge_t *e;
 
-    if (GD_has_labels(g->root) & EDGE_LABEL) {
+    if (GD_has_labels(g) & 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;