[gnome-calendar] gcal-year-view: refactored draw new-event marks
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-calendar] gcal-year-view: refactored draw new-event marks
- Date: Thu,  4 Dec 2014 22:27:59 +0000 (UTC)
commit 8d9e88013e52ccddb730352d984e764d1914c2e4
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Thu Jul 4 14:08:41 2013 -0400
    gcal-year-view: refactored draw new-event marks
    
    Make it more readable.
 src/gcal-year-view.c |   27 +++++++++------------------
 1 files changed, 9 insertions(+), 18 deletions(-)
---
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index 5357e2b..52716d4 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -788,30 +788,20 @@ gcal_year_view_draw_grid (GcalYearView *view,
                              background_selected_color.blue,
                              background_selected_color.alpha);
 
-      for (rows = 0; rows < (last_cell / 6) - (first_cell / 6) + 1; rows++)
+      for (rows = 0; rows < last_cell / 6 - first_cell / 6 + 1; rows++)
         {
           gint first_point;
           gint last_point;
 
           first_point = (rows == 0) ? first_cell : ((first_cell / 6) + rows) * 6;
-          cairo_move_to (
-              cr,
-              (alloc->width / 6) * ( first_point % 6),
-              (alloc->height / 2) * ( first_point / 6) + 1);
-
           last_point = (rows == (last_cell / 6 - first_cell / 6)) ? last_cell : ((first_cell / 6) + rows) * 
6 + 5;
-          cairo_rel_line_to (cr,
-                             (alloc->width / 6) * (last_point - first_point + 1),
-                             0);
-          cairo_rel_line_to (cr,
-                             0,
-                             alloc->height / 2);
-          cairo_rel_line_to (cr,
-                             - (alloc->width / 6) * (last_point - first_point + 1),
-                             0);
-          cairo_rel_line_to (cr,
-                             0,
-                             - alloc->height / 2);
+
+          cairo_rectangle (cr,
+                           (alloc->width / 6) * ( first_point % 6),
+                           (alloc->height / 2) * ( first_point / 6) + 1,
+                           (alloc->width / 6) * (last_point - first_point + 1),
+                           alloc->height / 2);
+
           cairo_fill (cr);
         }
 
@@ -940,6 +930,7 @@ gcal_year_view_get_final_date (GcalView *view)
 
   return new_date;
 }
+
 static void
 gcal_year_view_mark_current_unit (GcalView *view,
                                   gint     *x,
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]