]> err.no Git - libchamplain/commitdiff
Fix a precision issue
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sat, 16 May 2009 19:35:16 +0000 (15:35 -0400)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 3 Aug 2009 22:16:08 +0000 (18:16 -0400)
champlain/champlain-private.h
champlain/champlain-view.c
tidy/tidy-finger-scroll.c
tidy/tidy-viewport.c
tidy/tidy-viewport.h

index 9c7e4e569fd7b0a0d027628cf96398f0ebf1db19..86288c13b5c17271c20e0a1750ae2ab38804d23a 100644 (file)
 
 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;
index 82f9d6dff9fc927ec7ed15229f97263b9dcf3709..fddc7602ae6691caba8b70387bc8b5569472a21d 100644 (file)
@@ -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);
 }
 
 /**
index 0980cb779fb324b81df69b0e273a025da54a789b..db9f5d9ea3b4a2ffc6b1cb862cd36fb7bb059971 100644 (file)
@@ -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);
index 1064b1e31174e3f53b029c4a3f44a47d05cd86b7..4756f6cc3f7ac3c66e4f593f533cda2e420dfd45 100644 (file)
@@ -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;
 
index b94ecd78078b9dd1a986a91d4029a4d9c7f74eac..1ee9b3508090c8fcc0cf3aedcb74b7d25bbc8b9e 100644 (file)
@@ -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,