From 410ae8c46fee7278ccedd81dd70b172d0568eec4 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 1 Apr 2011 18:25:25 +0000 Subject: [PATCH] For nop mode, turn off any adjustment of nodes in neato_set_aspect if background is present; use AllEdges if there are no edges. --- lib/neatogen/neatoinit.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index 73dd037a8..3777481e9 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -433,8 +433,12 @@ static pos_edge nop_init_edges(Agraph_t * g) node_t *n; edge_t *e; int nedges = 0; - attrsym_t *E_pos = agfindedgeattr(g, "pos"); + attrsym_t *E_pos; + if (agnedges(g)) == 0) + return AllEdges; + + E_pos = agfindedgeattr(g, "pos"); if (!E_pos || (Nop < 2)) return NoEdges; @@ -705,8 +709,10 @@ int init_nop(Agraph_t * g, int adjust) nop_init_graphs(g, G_lp, G_bb); posEdges = nop_init_edges(g); - if (GD_drawing(g)->xdots) + if (GD_drawing(g)->xdots) { haveBackground = 1; + GD_drawing(g)->ratio_kind = R_NONE; /* Turn off any aspect change if background present */ + } else haveBackground = 0; -- 2.40.0