]> granicus.if.org Git - graphviz/commitdiff
For nop mode, turn off any adjustment of nodes in neato_set_aspect if background...
authorerg <devnull@localhost>
Fri, 1 Apr 2011 18:25:25 +0000 (18:25 +0000)
committererg <devnull@localhost>
Fri, 1 Apr 2011 18:25:25 +0000 (18:25 +0000)
use AllEdges if there are no edges.

lib/neatogen/neatoinit.c

index 73dd037a8476df671578c68e1433b6f46827d759..3777481e967724fec649530bf7587fbe76accea9 100644 (file)
@@ -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;