]> granicus.if.org Git - graphviz/commitdiff
fix (hopefully) rounding error causing -ve coords
authorellson <devnull@localhost>
Tue, 5 Aug 2008 19:03:23 +0000 (19:03 +0000)
committerellson <devnull@localhost>
Tue, 5 Aug 2008 19:03:23 +0000 (19:03 +0000)
lib/common/shapes.c

index 5f3473b62a5109eee3cda556265b0db226200652..aded3533fcd795948c61f62fb4f3b966e7ebfb23 100644 (file)
@@ -2159,10 +2159,11 @@ static void record_init(node_t * n)
        sz.y = MAX(info->size.y, sz.y);
     }
     resize_reclbl(info, sz, mapbool(late_string(n, N_nojustify, "false")));
-    ul = pointof(-sz.x / 2, sz.y / 2);
+    ul = pointof(-sz.x / 2, sz.y / 2);          /* suspected to introduce ronding error - see Kluge below */
     pos_reclbl(info, ul, sides);
     ND_width(n) = PS2INCH(info->size.x);
-    ND_height(n) = PS2INCH(info->size.y);
+    ND_height(n) = PS2INCH(info->size.y + 1);   /* Kluge!!  +1 to fix rounding diff between layout and rendering 
+                                                       otherwise we can get -1 coords in output */
     ND_shape_info(n) = (void *) info;
 }