From: erg Date: Fri, 1 Apr 2011 18:25:25 +0000 (+0000) Subject: For nop mode, turn off any adjustment of nodes in neato_set_aspect if background... X-Git-Tag: LAST_LIBGRAPH~32^2~882 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=410ae8c46fee7278ccedd81dd70b172d0568eec4;p=graphviz For nop mode, turn off any adjustment of nodes in neato_set_aspect if background is present; use AllEdges if there are no edges. --- 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;