week-header: don't allow negative widths

This commit is contained in:
Georges Basile Stavracas Neto
2016-12-01 23:48:54 -02:00
parent 92ba507b9e
commit de36d449ed
+2
View File
@@ -1097,6 +1097,8 @@ gcal_week_header_add_event (GcalWeekHeader *self,
if (g_date_time_compare (week_end, end_date) < 0)
width -= ceil (g_date_time_difference (end_date, week_end) / G_TIME_SPAN_DAY);
width = MAX (width, 1);
g_message ("ADD: '%s' (pos: %d, width: %d)", gcal_event_get_summary (event), weekday, width);
add_event_to_grid (self, event, weekday, weekday + width - 1);