summaryrefslogtreecommitdiff
path: root/liblogdiag
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-02-05 18:52:51 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-02-05 18:52:51 +0100
commit611b11508a910118694b6da0958a022826c07b29 (patch)
tree2c132db486ea2e0a606fafdf7d4445ba47de2f37 /liblogdiag
parent3cec64ebe8e04b42fadaa6cba03960606d852832 (diff)
downloadlogdiag-611b11508a910118694b6da0958a022826c07b29.tar.gz
logdiag-611b11508a910118694b6da0958a022826c07b29.tar.xz
logdiag-611b11508a910118694b6da0958a022826c07b29.zip
Make grid dots pixel-sharp.
Diffstat (limited to 'liblogdiag')
-rw-r--r--liblogdiag/ld-canvas.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/liblogdiag/ld-canvas.c b/liblogdiag/ld-canvas.c
index 7f0b236..4238876 100644
--- a/liblogdiag/ld-canvas.c
+++ b/liblogdiag/ld-canvas.c
@@ -1662,6 +1662,7 @@ draw_grid (GtkWidget *widget, DrawData *data)
gint grid_factor;
gdouble x_init, y_init;
gdouble x, y;
+ gdouble x_round, y_round;
grid_step = data->scale;
grid_factor = 1;
@@ -1694,8 +1695,10 @@ draw_grid (GtkWidget *widget, DrawData *data)
for (y = y_init; y <= data->exposed_rect.y + data->exposed_rect.height;
y += grid_step)
{
- cairo_move_to (data->cr, x, y);
- cairo_line_to (data->cr, x, y);
+ x_round = floor (x) + 0.5;
+ y_round = floor (y) + 0.5;
+ cairo_move_to (data->cr, x_round, y_round);
+ cairo_line_to (data->cr, x_round, y_round);
}
}
cairo_stroke (data->cr);