From b3a95d0299386bccbdebb967d15f4df02cf15891 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 10 Oct 2010 02:31:45 +0200 Subject: gnome-canvas: Change GnomeCanvasItem->point vfunc Previously the function returned the distance to the nearest item. Now it only returns an item that is hit. This slightly changes semantics (button events are no longer dispatched to the nearest item, but only to the item actually clicked on), but makes the code way simpler and actually does what one would expect. --- widgets/misc/e-calendar-item.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'widgets/misc/e-calendar-item.c') diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index f5d2f870af..5ca1143c96 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -90,12 +90,11 @@ static void e_calendar_item_draw_day_numbers (ECalendarItem *calitem, gint start_weekday, gint cells_x, gint cells_y); -static gdouble e_calendar_item_point (GnomeCanvasItem *item, +static GnomeCanvasItem *e_calendar_item_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, - gint cy, - GnomeCanvasItem **actual_item); + gint cy); static void e_calendar_item_stop_selecting (ECalendarItem *calitem, guint32 time); static void e_calendar_item_selection_add_days (ECalendarItem *calitem, @@ -1760,13 +1759,11 @@ e_calendar_item_get_week_number (ECalendarItem *calitem, /* This is supposed to return the nearest item the the point and the distance. Since we are the only item we just return ourself and 0 for the distance. This is needed so that we get button/motion events. */ -static double +static GnomeCanvasItem * e_calendar_item_point (GnomeCanvasItem *item, gdouble x, gdouble y, - gint cx, gint cy, - GnomeCanvasItem **actual_item) + gint cx, gint cy) { - *actual_item = item; - return 0.0; + return item; } static void -- cgit v1.2.3