2008-05-20 Alejandro G. Castro <alex@igalia.com>
+ Bouncing effect added when touching the borders, you can change
+ the elasticity of the border changing the ELASTICITY define.
+
+ * src/hildon-pannable-area.c: Added ELASTICITY define.
+ (hildon_pannable_area_timeout): Added inverse velocity when
+ touching the border of the child widget, that causes a bounce.
+
+2008-05-20 Alejandro G. Castro <alex@igalia.com>
+
Improved performance, we now do not go to the X server in order to
get the list of window children. Apparently the effect is the
same, we have to be careful and check if this breaks something in
#define SMOOTH_FACTOR 0.85
#define FORCE 5
+#define ELASTICITY 0.3
#include <gdk/gdkx.h>
#include "hildon-pannable-area.h"
* initial scroll position to the new mouse co-ordinate. This means
* when you get to the top of the page, dragging down works immediately.
*/
- if (!sx) priv->x = priv->ex;
- if (!sy) priv->y = priv->ey;
+ if (!sx) {
+ priv->x = priv->ex;
+ priv->vel_x *= -1 * priv->decel * ELASTICITY;
+ }
+ if (!sy) {
+ priv->y = priv->ey;
+ priv->vel_y *= -1 * priv->decel * ELASTICITY;
+ }
+
return TRUE;
}