rrdtool/rrdtool-zero_vs_nothing.patch
Dirk Mueller f2c31df8ab Accepting request 443080 from home:luizluca:branches:devel:languages:python
Updated to 1.6.0

As since upstream now supports lua since 5.0 (tested until 5.2), maybe it should remove the fixed requirement lua51-devel

OBS-URL: https://build.opensuse.org/request/show/443080
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/rrdtool?expand=0&rev=71
2016-12-06 12:05:05 +00:00

30 lines
1.1 KiB
Diff

Index: rrdtool-1.6.0/src/rrd_gfx.c
===================================================================
--- rrdtool-1.6.0.orig/src/rrd_gfx.c
+++ rrdtool-1.6.0/src/rrd_gfx.c
@@ -329,10 +329,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 - 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;
+ 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;
cairo_device_to_user(cr, x, y);
}
@@ -348,7 +348,7 @@ void gfx_area_fit(
if (!im->gridfit)
return;
cairo_user_to_device(cr, x, y);
- *x = floor(*x);
- *y = ceil(*y);
+ *x = (double) ((long) (*x + 0.5));
+ *y = (double) ((long) (*y + 0.5));
cairo_device_to_user(cr, x, y);
}