]> granicus.if.org Git - graphviz/commitdiff
Fix for bug 625 - when gd is used without freetype, need to set display
authorerg <devnull@localhost>
Fri, 4 Feb 2005 22:02:26 +0000 (22:02 +0000)
committererg <devnull@localhost>
Fri, 4 Feb 2005 22:02:26 +0000 (22:02 +0000)
dpi and make sure 2 call occur after this is set.

lib/common/input.c

index 2decf1bf6fd348040e905fcd9bb0caf6033ecc99..27225d9346f106adaa4dd99fb5194442ec3be0ba 100644 (file)
@@ -415,9 +415,6 @@ graph_t *next_input_graph(void)
 
 void graph_init(graph_t * g)
 {
-#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
-    initDPI(g);
-#endif
     /* initialize the graph */
     init_ugraph(g);
 
@@ -557,7 +554,6 @@ void init_ugraph(graph_t * g)
        else if (streq(p, "RL"))
            GD_rankdir(g) = RANKDIR_RL;
     }
-    do_graph_label(g);
     xf = late_double(g, agfindattr(g, "nodesep"), DEFAULT_NODESEP,
                     MIN_NODESEP);
     GD_nodesep(g) = POINTS(xf);
@@ -603,6 +599,13 @@ void init_ugraph(graph_t * g)
        || ((p = agget(g, "resolution")) && p[0]))
        GD_drawing(g)->dpi = atof(p);
 
+    /* The following two functions rely on dpi being set */
+#if !defined(DISABLE_CODEGENS) && !defined(HAVE_GD_FREETYPE)
+    if (GD_drawing(g)->dpi < 1.0) GD_drawing(g)->dpi = DEFAULT_DPI;
+    initDPI(g);
+#endif
+    do_graph_label(g);
+
     Nodesep = 1.0;
     Nodefactor = 1.0;
     Initial_dist = MYHUGE;