summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6cc6a43)
raw | patch | inline | side by side (parent: 6cc6a43)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 16 Dec 2011 17:40:15 +0000 (17:40 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 16 Dec 2011 17:40:15 +0000 (17:40 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.4/program@2244 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_gfx.c | patch | blob | history |
diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c
index 429ea472748bb02398bacceb7f48c62a5bcc6b9e..30bf7912842ec6fc4e683ef8fa9c41e8c2375799 100644 (file)
--- a/src/rrd_gfx.c
+++ b/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);
}