From: Pierre-Luc Beaudoin Date: Sat, 16 May 2009 19:35:16 +0000 (-0400) Subject: Fix a precision issue X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=118a55dbb5718101e1d3a1e83c690431c611e17a;p=libchamplain Fix a precision issue --- diff --git a/champlain/champlain-private.h b/champlain/champlain-private.h index 9c7e4e5..86288c1 100644 --- a/champlain/champlain-private.h +++ b/champlain/champlain-private.h @@ -24,13 +24,6 @@ typedef struct _Map Map; -typedef struct -{ - gint x; - gint y; - gint z; -} ChamplainIntPoint; - struct _ChamplainBaseMarkerPrivate { gdouble lon; @@ -52,8 +45,8 @@ struct _ChamplainPolygonPrivate { typedef struct { - gint x; - gint y; + gfloat x; + gfloat y; gint width; gint height; } ChamplainRectangle; diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c index 82f9d6d..fddc760 100644 --- a/champlain/champlain-view.c +++ b/champlain/champlain-view.c @@ -1079,7 +1079,7 @@ viewport_x_changed_cb (GObject *gobject, diff.x = priv->anchor.x - old_anchor.x; diff.y = priv->anchor.y - old_anchor.y; - DEBUG("Relocating the viewport by %d, %d", diff.x, diff.y); + DEBUG("Relocating the viewport by %f, %f", diff.x, diff.y); tidy_viewport_set_origin (TIDY_VIEWPORT (priv->viewport), rect.x - diff.x, rect.y - diff.y, 0); return; @@ -1221,7 +1221,7 @@ view_update_anchor (ChamplainView *view, priv->anchor.y = 0; priv->anchor_zoom_level = priv->zoom_level; } - DEBUG ("New Anchor (%d, %d) for (%d, %d)", priv->anchor.x, priv->anchor.y, x, y); + DEBUG ("New Anchor (%f, %f) for (%d, %d)", priv->anchor.x, priv->anchor.y, x, y); } /** diff --git a/tidy/tidy-finger-scroll.c b/tidy/tidy-finger-scroll.c index 0980cb7..db9f5d9 100644 --- a/tidy/tidy-finger-scroll.c +++ b/tidy/tidy-finger-scroll.c @@ -189,8 +189,8 @@ motion_event_cb (ClutterActor *actor, TidyFingerScrollPrivate *priv = scroll->priv; if (clutter_actor_transform_stage_point (actor, - CLUTTER_UNITS_FROM_DEVICE(event->x), - CLUTTER_UNITS_FROM_DEVICE(event->y), + event->x, + event->y, &x, &y)) { TidyFingerScrollMotion *motion; @@ -378,11 +378,11 @@ button_release_event_cb (ClutterActor *actor, ClutterUnit x, y; if (clutter_actor_transform_stage_point (actor, - CLUTTER_UNITS_FROM_DEVICE(event->x), - CLUTTER_UNITS_FROM_DEVICE(event->y), + event->x, + event->y, &x, &y)) { - ClutterUnit frac, x_origin, y_origin; + double frac, x_origin, y_origin; GTimeVal release_time, motion_time; TidyAdjustment *hadjust, *vadjust; glong time_diff; @@ -592,8 +592,8 @@ captured_event_cb (ClutterActor *actor, if ((bevent->button == 1) && (clutter_actor_transform_stage_point (actor, - CLUTTER_UNITS_FROM_DEVICE(bevent->x), - CLUTTER_UNITS_FROM_DEVICE(bevent->y), + bevent->x, + bevent->y, &motion->x, &motion->y))) { g_get_current_time (&motion->time); diff --git a/tidy/tidy-viewport.c b/tidy/tidy-viewport.c index 1064b1e..4756f6c 100644 --- a/tidy/tidy-viewport.c +++ b/tidy/tidy-viewport.c @@ -530,9 +530,9 @@ tidy_viewport_new (void) void tidy_viewport_set_origin (TidyViewport *viewport, - gint x, - gint y, - gint z) + float x, + float y, + float z) { TidyViewportPrivate *priv; @@ -575,9 +575,9 @@ tidy_viewport_set_origin (TidyViewport *viewport, void tidy_viewport_get_origin (TidyViewport *viewport, - gint *x, - gint *y, - gint *z) + float *x, + float *y, + float *z) { TidyViewportPrivate *priv; diff --git a/tidy/tidy-viewport.h b/tidy/tidy-viewport.h index b94ecd7..1ee9b35 100644 --- a/tidy/tidy-viewport.h +++ b/tidy/tidy-viewport.h @@ -56,9 +56,9 @@ GType tidy_viewport_get_type (void) G_GNUC_CONST; ClutterActor * tidy_viewport_new (void); void tidy_viewport_set_origin (TidyViewport *viewport, - gint x, - gint y, - gint z); + float x, + float y, + float z); void tidy_viewport_get_origin (TidyViewport *viewport, gfloat *x,