Hello all,

I have another issue in scroller when the bounce is off.
Scroller cannot be clicked even if it reach to edge and animation is end.
The reason is why the momentum animation is running even if it reach end and 
bounce animation is off.
So I change the code that if it reach the edge in case of bounce-off, the 
momentum animation is stoped.
The following is the patch code.
Please check it.

Thanks.


Index: src/lib/els_scroller.c
===================================================================
--- src/lib/els_scroller.c      (revision 56235)
+++ src/lib/els_scroller.c      (working copy)
@@ -690,6 +690,7 @@ _smart_momentum_animator(void *data)
    Smart_Data *sd;
    double t, dt, p;
    Evas_Coord x, y, dx, dy, px, py, maxx, maxy, minx, miny;
+   Eina_Bool no_bounce_x_end = EINA_FALSE, no_bounce_y_end = EINA_FALSE;
 
    sd = data;
    t = ecore_loop_time_get();
@@ -738,8 +739,19 @@ _smart_momentum_animator(void *data)
        elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
         sd->pan_func.max_get(sd->pan_obj, &maxx, &maxy);
         sd->pan_func.min_get(sd->pan_obj, &minx, &miny);
+       if (!sd->bounce_horiz)
+          {
+             if (x <= minx) no_bounce_x_end = EINA_TRUE;
+             if ((x - minx) >= maxx) no_bounce_x_end = EINA_TRUE;
+          }
+        if (!sd->bounce_vert)
+          {
+             if (y <= miny) no_bounce_y_end = EINA_TRUE;
+             if ((y - miny) >= maxy) no_bounce_y_end = EINA_TRUE;
+          }
         if ((dt >= 1.0) || 
-            ((sd->down.bounce_x_hold) && (sd->down.bounce_y_hold)))
+            ((sd->down.bounce_x_hold) && (sd->down.bounce_y_hold)) ||
+            (no_bounce_x_end && no_bounce_y_end))
          {
              _smart_anim_stop(sd->smart_obj);
             sd->down.momentum_animator = NULL;
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to