aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-10-13 23:37:17 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-10-13 23:37:17 +0800
commit6dd325d7ea195125a87769f8e51ef1b167720cc6 (patch)
tree5efd43c24beec8d450367f9039c05d9ed8890068 /calendar
parent6bc3532cbbaedbbfa116016672135aac1adaede2 (diff)
downloadgsoc2013-evolution-6dd325d7ea195125a87769f8e51ef1b167720cc6.tar
gsoc2013-evolution-6dd325d7ea195125a87769f8e51ef1b167720cc6.tar.gz
gsoc2013-evolution-6dd325d7ea195125a87769f8e51ef1b167720cc6.tar.bz2
gsoc2013-evolution-6dd325d7ea195125a87769f8e51ef1b167720cc6.tar.lz
gsoc2013-evolution-6dd325d7ea195125a87769f8e51ef1b167720cc6.tar.xz
gsoc2013-evolution-6dd325d7ea195125a87769f8e51ef1b167720cc6.tar.zst
gsoc2013-evolution-6dd325d7ea195125a87769f8e51ef1b167720cc6.zip
Sync - Federico
svn path=/trunk/; revision=448
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/month-view.c17
-rw-r--r--calendar/month-view.c17
2 files changed, 28 insertions, 6 deletions
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 */
diff --git a/calendar/month-view.c b/calendar/month-view.c
index 46f181c654..a5a5ce308a 100644
--- a/calendar/month-view.c
+++ b/calendar/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 */