summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aabc1fd)
raw | patch | inline | side by side (parent: aabc1fd)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 16 Dec 2011 17:39:14 +0000 (17:39 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 16 Dec 2011 17:39:14 +0000 (17:39 +0000) |
program/src/rrd_gfx.c | patch | blob | history |
diff --git a/program/src/rrd_gfx.c b/program/src/rrd_gfx.c
index 416b8a32ada2244d9567498688c920e6b526afb7..c01a66187f52082bcb349884a1372ac0d1546b13 100644 (file)
--- a/program/src/rrd_gfx.c
+++ b/program/src/rrd_gfx.c
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 = ceil(*x - 0.5) - line_width;
+ *y = ceil(*y + 0.5) + line_height;
cairo_device_to_user(cr, x, y);
}
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);
}