From 0db52d8c2b919b6753e45868d5223d9f7150ca3e Mon Sep 17 00:00:00 2001 From: erg Date: Tue, 16 Feb 2010 22:35:23 +0000 Subject: [PATCH] Change neato so that the layout of a connected graph is done on the graph itself, not an induced subgraph. I can't recall why I made this change, but I remember it was necessary to fix a problem. At the worst, it will make this case faster without changing the overall semantics. --- lib/neatogen/neatoinit.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index ca0a3dd1f..599d4a489 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -1521,16 +1521,16 @@ void neato_layout(Agraph_t * g) cc = pccomps(g, &n_cc, cc_pfx, &pin); - for (i = 0; i < n_cc; i++) { - gc = cc[i]; - nodeInduce(gc); - neatoLayout(g, gc, layoutMode, model, &am); - removeOverlapWith(gc, &am); - setEdgeType (gc, ET_LINE); - spline_edges(gc); - } if (n_cc > 1) { boolean *bp; + for (i = 0; i < n_cc; i++) { + gc = cc[i]; + nodeInduce(gc); + neatoLayout(g, gc, layoutMode, model, &am); + removeOverlapWith(gc, &am); + setEdgeType (gc, ET_LINE); + spline_edges(gc); + } if (pin) { bp = N_NEW(n_cc, boolean); bp[0] = TRUE; @@ -1543,6 +1543,11 @@ void neato_layout(Agraph_t * g) if (bp) free(bp); } + else { + neatoLayout(g, g, layoutMode, model, &am); + removeOverlapWith(g, &am); + spline_edges(g); + } compute_bb(g); addZ (g); -- 2.40.0