From dfd9973edd922880b65f32494cfa45287284a010 Mon Sep 17 00:00:00 2001 From: erg Date: Tue, 12 Dec 2006 00:03:32 +0000 Subject: [PATCH] Handle circuit model when graph has 1 node --- lib/neatogen/neatoinit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index 23d47fdf5..756b1d48c 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -55,7 +55,7 @@ void neato_nodesize(node_t * n, boolean flip) void neato_init_node(node_t * n) { common_init_node(n); - ND_pos(n) = ALLOC(GD_ndim(n->graph), 0, double); + ND_pos(n) = N_NEW(GD_ndim(n->graph), double); neato_nodesize(n, GD_flip(n->graph)); } @@ -1297,7 +1297,7 @@ void neatoLayout(Agraph_t * mg, Agraph_t * g, int layoutMode, int layoutModel) MaxIter = 100 * agnnodes(g); nG = scan_graph_mode(g, layoutMode); - if (!nG) + if (nG < 2) return; if (layoutMode) majorization(mg, g, nG, layoutMode, layoutModel, Ndim, MaxIter); -- 2.40.0