[gnome-calendar/ui-rewrite] month-view: fix cell rendering glitch



commit ed66f463fa71e8b97bc550a445c79616acc58a9d
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Tue Oct 28 12:10:31 2014 -0400

    month-view: fix cell rendering glitch
    
    Bug: https://bugzilla.gnome.org/show_bug.cgi?id=739294

 src/gcal-month-view.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 0fb4168..55e5bb2 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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]