[gnome-calendar/wip/pandusonu/week-view: 53/60] week-header: don't allow negative widths



commit de36d449ed97bed1266ae3de672599f3b966992d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun Nov 6 19:48:51 2016 -0200

    week-header: don't allow negative widths

 src/views/gcal-week-header.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/views/gcal-week-header.c b/src/views/gcal-week-header.c
index 00974ce..75a89e6 100644
--- a/src/views/gcal-week-header.c
+++ b/src/views/gcal-week-header.c
@@ -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);


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