From 6dd325d7ea195125a87769f8e51ef1b167720cc6 Mon Sep 17 00:00:00 2001 From: Arturo Espinosa Date: Tue, 13 Oct 1998 15:37:17 +0000 Subject: Sync - Federico svn path=/trunk/; revision=448 --- calendar/gui/month-view.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'calendar/gui/month-view.c') diff --git a/calendar/gui/month-view.c b/calendar/gui/month-view.c index 46f181c654..a5a5ce308a 100644 --- a/calendar/gui/month-view.c +++ b/calendar/gui/month-view.c @@ -219,6 +219,8 @@ adjust_segment (MonthView *mv, struct child *child, struct segment *seg) double x1, y1, x2, y2; double y; double slot_width; + time_t day_begin, day_end; + double start_factor, end_factor; mitem = GNOME_MONTH_ITEM (mv->mitem); @@ -242,13 +244,22 @@ adjust_segment (MonthView *mv, struct child *child, struct segment *seg) day_width = x2 - x1; day_height = y2 - y1; - slot_width = day_width / child->slots_used; + slot_width = day_width / mv->num_slots; /* Set the coordinates of the segment's item */ - + day_begin = time_day_begin (seg->start); + day_end = time_day_end (seg->end); - + start_factor = (double) (seg->start - day_begin) / (day_end - day_begin); + end_factor = (double) (seg->end - day_begin) / (day_end - day_begin); + + gnome_canvas_item_set (seg->item, + "x1", x1 + slot_width * child->slot_start, + "y1", y1 + day_height * start_factor, + "x2", x1 + slot_width * (child->slot_start + child->slots_used), + "y2", y1 + day_height * end_factor, + NULL); } /* Adjusts the child events of the month view to the appropriate size and position */ -- cgit v1.2.3