From 2c2f31b1be57380d4368f6da1d0a4529a5a7f8c1 Mon Sep 17 00:00:00 2001 From: Michael Mortensen Date: Sun, 26 Jul 2009 20:13:36 +0100 Subject: [PATCH] [osx] Update events to floating point coordinates The event translation code should be using the float type for coordinates. Fixes bug: http://bugzilla.openedhand.com/show_bug.cgi?id=1725 Signed-off-by: Emmanuele Bassi --- clutter/osx/clutter-event-osx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/clutter/osx/clutter-event-osx.c b/clutter/osx/clutter-event-osx.c index e2df62178..1ff42d980 100644 --- a/clutter/osx/clutter-event-osx.c +++ b/clutter/osx/clutter-event-osx.c @@ -40,7 +40,7 @@ static GPollFunc old_poll_func = NULL; @interface NSEvent (Clutter) - (gint)clutterTime; - (gint)clutterButton; -- (void)clutterX:(gint*)ptrX y:(gint*)ptrY; +- (void)clutterX:(gfloat*)ptrX y:(gfloat*)ptrY; - (gint)clutterModifierState; - (guint)clutterKeyVal; @end @@ -62,13 +62,13 @@ static GPollFunc old_poll_func = NULL; } } -- (void)clutterX:(gint*)ptrX y:(gint*)ptrY +- (void)clutterX:(gfloat*)ptrX y:(gfloat*)ptrY { NSView *view = [[self window] contentView]; NSPoint pt = [view convertPoint:[self locationInWindow] fromView:nil]; - *ptrX = (gint)pt.x; - *ptrY = (gint)pt.y; + *ptrX = pt.x; + *ptrY = pt.y; } - (gint)clutterModifierState @@ -199,7 +199,7 @@ clutter_event_osx_translate (NSEvent *nsevent, ClutterEvent *event) case NSOtherMouseDragged: event->type = CLUTTER_MOTION; - [nsevent clutterX:(&event->motion.x) y:&(event->motion.y)]; + [nsevent clutterX:&(event->motion.x) y:&(event->motion.y)]; event->motion.modifier_state = [nsevent clutterModifierState]; CLUTTER_NOTE (EVENT, "motion %d at %d,%d",