Added a threshold to push the animation if the speed is big (MAX_SPEED_THRESHOLD).
authorAlejandro G. Castro <alex@igalia.com>
Fri, 22 May 2009 09:27:56 +0000 (11:27 +0200)
committerAlejandro G. Castro <alex@igalia.com>
Mon, 25 May 2009 17:38:44 +0000 (19:38 +0200)
* hildon/hildon-pannable-area.c
(hildon_pannable_area_button_release_cb): Added a threshold to
push the animation if the speed is big (MAX_SPEED_THRESHOLD).

ChangeLog
hildon/hildon-pannable-area.c

index 3f35ecd..f430556 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-05-25  Alejandro G. Castro  <alex@igalia.com>
 
+       * hildon/hildon-pannable-area.c
+       (hildon_pannable_area_button_release_cb): Added a threshold to
+       push the animation if the speed is big (MAX_SPEED_THRESHOLD).
+
+2009-05-25  Alejandro G. Castro  <alex@igalia.com>
+
        * hildon/hildon-pannable-area.c,
        (hildon_pannable_area_set_property): Added code to sync the gtk
        dnd threshold with the panning threshold.
index 230f4c7..5fe1527 100644 (file)
@@ -57,6 +57,7 @@
 #define SCROLL_FADE_TIMEOUT 100
 #define MOTION_EVENTS_PER_SECOND 25
 #define CURSOR_STOPPED_TIMEOUT 80
+#define MAX_SPEED_THRESHOLD 250
 #define PANNABLE_MAX_WIDTH 788
 #define PANNABLE_MAX_HEIGHT 378
 
@@ -2590,6 +2591,12 @@ hildon_pannable_area_button_release_cb (GtkWidget * widget,
     if ((ABS (priv->vel_y) >= priv->vmin) ||
         (ABS (priv->vel_x) >= priv->vmin)) {
 
+      if (ABS (priv->vel_x) > MAX_SPEED_THRESHOLD)
+        priv->vel_x = (priv->vel_x > 0) ? priv->vmax : -priv->vmax;
+
+      if (ABS (priv->vel_y) > MAX_SPEED_THRESHOLD)
+        priv->vel_y = (priv->vel_y > 0) ? priv->vmax : -priv->vmax;
+
       if (!priv->idle_id)
         priv->idle_id = gdk_threads_add_timeout ((gint) (1000.0 / (gdouble) priv->sps),
                                                  (GSourceFunc)