]> granicus.if.org Git - graphviz/commitdiff
fix small rounding error in Y pos of labels between cg and gd plugin that was detecte...
authorellson <devnull@localhost>
Mon, 28 Nov 2005 23:58:39 +0000 (23:58 +0000)
committerellson <devnull@localhost>
Mon, 28 Nov 2005 23:58:39 +0000 (23:58 +0000)
lib/common/labels.c

index 4c2fdec1eaf0417df11f225bce33e72b98a8683c..90b67865465a7f50d569980c63f2e58efbd34978 100644 (file)
@@ -168,7 +168,7 @@ emit_textlines(GVJ_t* job, int nlines, textline_t lines[], pointf p,
               double halfwidth_x, char* fname, double fsize, char* fcolor)
 {
     int i, linespacing;
-    double center_x, left_x, right_x;
+    double tmp, center_x, left_x, right_x;
 
     center_x = p.x;
     left_x = center_x - halfwidth_x;
@@ -181,6 +181,9 @@ emit_textlines(GVJ_t* job, int nlines, textline_t lines[], pointf p,
     p.y += (linespacing * (nlines - 1) / 2)    /* cl of topline */
        -fsize / 3.0;   /* cl to baseline */
 
+    tmp = ROUND(p.y);  /* align with interger points */
+    p.y = (double)tmp;
+
     gvrender_begin_context(job);
     gvrender_set_pencolor(job, fcolor);
     gvrender_set_font(job, fname, fsize);