From 526b438b3a4ebc446a1f986dcaeb759377462c18 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Fri, 20 Aug 2010 11:25:40 +0100 Subject: [PATCH] cookbook: Use get_coords rather than struct members Use clutter_event_get_coords() to get x and y position, rather than casting to the right event type then directly accessing members of the event struct. --- doc/cookbook/examples/events-pointer-motion.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/cookbook/examples/events-pointer-motion.c b/doc/cookbook/examples/events-pointer-motion.c index 0b851e6c7..6bc55e5e1 100644 --- a/doc/cookbook/examples/events-pointer-motion.c +++ b/doc/cookbook/examples/events-pointer-motion.c @@ -8,10 +8,8 @@ _pointer_motion_cb (ClutterActor *actor, ClutterEvent *event, gpointer user_data) { - ClutterMotionEvent *motion_event = (ClutterMotionEvent *)event; - - gfloat stage_x = motion_event->x; - gfloat stage_y = motion_event->y; + gfloat stage_x, stage_y; + clutter_event_get_coords (event, &stage_x, &stage_y); gfloat actor_x, actor_y; clutter_actor_transform_stage_point (actor,