[gnome-calendar/ui-rewrite] gcal-all-day-grid: fixed y coordinate calculation



commit 0892b97c7da4d2d706efead53b24d232bfd80c49
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Sat Jul 27 20:52:00 2013 -0400

    gcal-all-day-grid: fixed y coordinate calculation

 src/gcal-all-day-grid.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/gcal-all-day-grid.c b/src/gcal-all-day-grid.c
index 5616ec3..41eb466 100644
--- a/src/gcal-all-day-grid.c
+++ b/src/gcal-all-day-grid.c
@@ -1024,6 +1024,7 @@ gcal_all_day_grid_get_cell_position (GcalAllDayGrid *all_day,
   GtkBorder padding;
   PangoLayout *layout;
   PangoRectangle logical_rect;
+  gint y_gap;
 
   gint width_block;
 
@@ -1045,8 +1046,8 @@ gcal_all_day_grid_get_cell_position (GcalAllDayGrid *all_day,
       pango_layout_get_extents (layout, NULL, &logical_rect);
       pango_extents_to_pixels (&logical_rect, NULL);
 
-      *y = (gtk_widget_get_allocated_height (widget) -
-            (padding.top + logical_rect.height + padding.bottom)) / 2;
+      y_gap = padding.top + logical_rect.height + padding.bottom;
+      *y = y_gap + (gtk_widget_get_allocated_height (widget) - y_gap) / 2;
 
       g_object_unref (layout);
     }


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