]> granicus.if.org Git - graphviz/commitdiff
Fix bug in init_point which prevented large points.
authorerg <devnull@localhost>
Wed, 5 Mar 2008 21:44:22 +0000 (21:44 +0000)
committererg <devnull@localhost>
Wed, 5 Mar 2008 21:44:22 +0000 (21:44 +0000)
lib/common/shapes.c

index 41d82f96817c5da1dd7bfad52aa428ed1a83f78e..b23fb18dadafc282cca1b0cd156f55542bdb9db5 100644 (file)
@@ -1590,15 +1590,20 @@ static void point_init(node_t * n)
     double sz;
     pointf P, *vertices;
     int i, j;
+    double w, h;
 
     /* set width and height, and make them equal
      * if user has set weight or height, use it.
      * if both are set, use smallest.
      * if neither, use default
      */
-    ND_width(n) = late_double(n, N_width, DEF_POINT, MIN_POINT);
-    ND_height(n) = late_double(n, N_height, DEF_POINT, MIN_POINT);
-    ND_width(n) = ND_height(n) = MIN(ND_width(n), ND_height(n));
+    w = late_double(n, N_width, MAXDOUBLE, MIN_POINT);
+    h = late_double(n, N_height, MAXDOUBLE, MIN_POINT);
+    w = MIN(w,h);
+    if ((w == MAXDOUBLE) && (h == MAXDOUBLE)) /* neither defined */
+       ND_width(n) = ND_height(n) = DEF_POINT;
+    else
+       ND_width(n) = ND_height(n) = w;
 
     sz = ND_width(n)*POINTS_PER_INCH; 
     peripheries = late_int(n, N_peripheries, peripheries, 0);