[gnome-calendar] month-view: fix invalid cell calculation



commit 82b5953b764cf550544185343309e781da124be4
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat May 21 19:15:14 2016 -0300

    month-view: fix invalid cell calculation

 src/gcal-month-view.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index f666d44..9194db9 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -810,8 +810,11 @@ get_dnd_cell (GtkWidget *widget,
   cell = gather_button_event_data (GCAL_MONTH_VIEW (widget), x, y, NULL, NULL, NULL);
   cell = real_cell (cell, priv->k);
 
-  if (cell - priv->days_delay < g_date_get_days_in_month (priv->date->month, priv->date->year))
-    return cell;
+  if (cell >= priv->days_delay &&
+      cell < g_date_get_days_in_month (priv->date->month, priv->date->year) + priv->days_delay)
+    {
+      return cell;
+    }
 
   return -1;
 }


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