From de90213fd7b596f6af812842287d1847b1955708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Tue, 28 Oct 2014 12:10:31 -0400 Subject: [PATCH] month-view: fix cell rendering glitch Bug: https://bugzilla.gnome.org/show_bug.cgi?id=739294 --- src/gcal-month-view.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c index 0fb4168c..55e5bb25 100644 --- a/src/gcal-month-view.c +++ b/src/gcal-month-view.c @@ -726,16 +726,15 @@ gcal_month_view_draw (GtkWidget *widget, pos_y + 0.3, alloc.width / 7, (alloc.height - start_grid_y ) / 6); } - /* final gap */ - for (i = days + 7 * february_gap; i < 7 * (shown_rows == 5 ? 5 : 6); i++) + /* final gap: drawn horizontally to the end */ + i = days + 7 * february_gap; + if (i < 7 * (shown_rows == 5 ? 5 : 6)) { - gint column = i % 7; - gint row = i / 7; - pos_y = ((alloc.height - start_grid_y ) / 6) * (row + lines_gap_for_5) + start_grid_y; + pos_y = ((alloc.height - start_grid_y ) / 6) * ((i / 7) + lines_gap_for_5) + start_grid_y; cairo_rectangle (cr, - (alloc.width / 7) * column, + (alloc.width / 7) * (i % 7), pos_y + 0.3, - alloc.width / 7, (alloc.height - start_grid_y ) / 6); + alloc.width, (alloc.height - start_grid_y ) / 6); } cairo_fill (cr);