gcal-year-view: refactored draw new-event marks

Make it more readable.
This commit is contained in:
Erick Pérez Castellanos
2014-12-04 17:10:31 -05:00
parent 7c976b5a86
commit 8d9e88013e
+9 -18
View File
@@ -788,30 +788,20 @@ gcal_year_view_draw_grid (GcalYearView *view,
background_selected_color.blue, background_selected_color.blue,
background_selected_color.alpha); 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 first_point;
gint last_point; gint last_point;
first_point = (rows == 0) ? first_cell : ((first_cell / 6) + rows) * 6; 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; 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), cairo_rectangle (cr,
0); (alloc->width / 6) * ( first_point % 6),
cairo_rel_line_to (cr, (alloc->height / 2) * ( first_point / 6) + 1,
0, (alloc->width / 6) * (last_point - first_point + 1),
alloc->height / 2); 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_fill (cr); cairo_fill (cr);
} }
@@ -940,6 +930,7 @@ gcal_year_view_get_final_date (GcalView *view)
return new_date; return new_date;
} }
static void static void
gcal_year_view_mark_current_unit (GcalView *view, gcal_year_view_mark_current_unit (GcalView *view,
gint *x, gint *x,