X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Frrd_gfx.c;h=edc4fb6e3555beda177a114445aa2b13af38763a;hb=43d79b11a51ae02b7b0995945cb351799e932d66;hp=421332f103ecfffc919726e1a7882c36c16b9089;hpb=2d7eb66e602a5c53dc2fafd70aa6ec4d7b447be9;p=pkg-rrdtool.git diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c index 421332f..edc4fb6 100644 --- a/src/rrd_gfx.c +++ b/src/rrd_gfx.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.3.2 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.4.8 Copyright by Tobi Oetiker, 1997-2013 **************************************************************************** * rrd_gfx.c graphics wrapper for rrdtool **************************************************************************/ @@ -293,10 +293,10 @@ void gfx_line_fit( line_width = cairo_get_line_width(cr); line_height = line_width; cairo_user_to_device_distance(cr, &line_width, &line_height); - line_width = line_width / 2.0 - (long) (line_width / 2.0); - line_height = line_height / 2.0 - (long) (line_height / 2.0); - *x = (double) ((long) (*x + 0.5)) - line_width; - *y = (double) ((long) (*y + 0.5)) + line_height; + line_width = line_width / 2.0 - ceil(line_width / 2.0); + line_height = line_height / 2.0 - ceil(line_height / 2.0); + *x = floor(*x - 0.5) - line_width; + *y = ceil(*y + 0.5) + line_height; cairo_device_to_user(cr, x, y); } @@ -312,7 +312,7 @@ void gfx_area_fit( if (!im->gridfit) return; cairo_user_to_device(cr, x, y); - *x = (double) ((long) (*x + 0.5)); - *y = (double) ((long) (*y + 0.5)); + *x = floor(*x); + *y = ceil(*y); cairo_device_to_user(cr, x, y); }