From: ellson Date: Mon, 28 Nov 2005 23:58:39 +0000 (+0000) Subject: fix small rounding error in Y pos of labels between cg and gd plugin that was detecte... X-Git-Tag: LAST_LIBGRAPH~32^2~6941 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c515ea5b6b31c3c7a84be1269ce2255a95c3d3de;p=graphviz fix small rounding error in Y pos of labels between cg and gd plugin that was detected by diffimg --- diff --git a/lib/common/labels.c b/lib/common/labels.c index 4c2fdec1e..90b678654 100644 --- a/lib/common/labels.c +++ b/lib/common/labels.c @@ -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);