month-view: fix invalid cell calculation

This commit is contained in:
Georges Basile Stavracas Neto
2016-05-21 19:15:14 -03:00
parent 1c90791d3b
commit 82b5953b76
+5 -2
View File
@@ -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;
}