From 611b11508a910118694b6da0958a022826c07b29 Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Sat, 5 Feb 2011 18:52:51 +0100 Subject: Make grid dots pixel-sharp. --- liblogdiag/ld-canvas.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'liblogdiag') 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); -- cgit v1.2.3-70-g09d2