jaehwan pushed a commit to branch master.

commit 7cb09c14c8dede701c2332b9e50b9f8c1c16295b
Author: Jaehwan Kim <[email protected]>
Date:   Mon Apr 1 14:02:23 2013 +0900

    Scroller decides whether the accelerator is on or not, depending on the 
velocity and the interval time of the flick event.
---
 ChangeLog                          |  4 ++++
 NEWS                               |  1 +
 src/lib/elm_interface_scrollable.c | 28 ++++++++++++++++------------
 3 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9e2c00e..12e8ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1190,3 +1190,7 @@
 2013-03-29  Mike Blumenkrantz
 
         * Fix ctxpopup geometry when parent is an elm_win.
+
+2013-04-01  Jaehwan Kim
+
+        * Scroller decides whether the accelerator is on or not, depending on 
the velocity and the interval time of the flick event.
diff --git a/NEWS b/NEWS
index 0687d33..0eec980 100644
--- a/NEWS
+++ b/NEWS
@@ -90,6 +90,7 @@ Improvements:
    * Improve gengrid item append performance.
    * Naviframe works for H/W Back key event.
    * Naviframe is now supproting focus_direction.
+   * Scroller decides whether the accelerator is on or not, depending on the 
velocity and the interval time of the flick event.
 
 Fixes:
 
diff --git a/src/lib/elm_interface_scrollable.c 
b/src/lib/elm_interface_scrollable.c
index f49e209..e64bd2b 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -2280,6 +2280,7 @@ _elm_scroll_mouse_up_event_cb(void *data,
                            (vel > _elm_config->thumbscroll_momentum_threshold))
                          {
                             int minx, miny, mx, my, px, py;
+                            double tt = 0.0, dtt = 0.0;
 
                             eo_do(sid->pan_obj, elm_obj_pan_pos_min_get
                                   (&minx, &miny));
@@ -2289,22 +2290,12 @@ _elm_scroll_mouse_up_event_cb(void *data,
                             sid->down.dx = ((double)dx / at);
                             sid->down.dy = ((double)dy / at);
                             if (((sid->down.dx > 0) && (sid->down.pdx > 0)) ||
-                                ((sid->down.dx < 0) && (sid->down.pdx < 0)))
-                              if (px > minx && px < mx)
-                                sid->down.dx += (double)sid->down.pdx * 1.5;
-                            // FIXME: * 1.5 - probably should be config
-                            if (((sid->down.dy > 0) && (sid->down.pdy > 0)) ||
-                                ((sid->down.dy < 0) && (sid->down.pdy < 0)))
-                              if (py > miny && py < my)
-                                sid->down.dy += (double)sid->down.pdy * 1.5;
-                            // FIXME: * 1.5 - probably should be config
-                            if (((sid->down.dx > 0) && (sid->down.pdx > 0)) ||
                                 ((sid->down.dx < 0) && (sid->down.pdx < 0)) ||
                                 ((sid->down.dy > 0) && (sid->down.pdy > 0)) ||
                                 ((sid->down.dy < 0) && (sid->down.pdy < 0)))
                               {
-                                 double tt = ecore_loop_time_get();
-                                 double dtt = tt - sid->down.anim_start;
+                                 tt = ecore_loop_time_get();
+                                 dtt = tt - sid->down.anim_start;
 
                                  if (dtt < 0.0) dtt = 0.0;
                                  else if (dtt >
@@ -2315,6 +2306,19 @@ _elm_scroll_mouse_up_event_cb(void *data,
                               }
                             else
                               sid->down.extra_time = 0.0;
+
+                            if (abs(sid->down.dx) > 500 && (dtt < 0.7) &&
+                                (((sid->down.dx > 0) && (sid->down.pdx > 0)) ||
+                                ((sid->down.dx < 0) && (sid->down.pdx < 0))))
+                              if (px > minx && px < mx)
+                                sid->down.dx += (double)sid->down.pdx * 2.5;
+                            // FIXME: > 500, < 0.7, * 1.5 - probably should be 
config
+                            if (abs(sid->down.dy) > 500 && (dtt < 0.7) &&
+                                (((sid->down.dy > 0) && (sid->down.pdy > 0)) ||
+                                ((sid->down.dy < 0) && (sid->down.pdy < 0))))
+                              if (py > miny && py < my)
+                                sid->down.dy += (double)sid->down.pdy * 2.5;
+                            // FIXME: > 500, < 0.7, * 1.5 - probably should be 
config
                             sid->down.pdx = sid->down.dx;
                             sid->down.pdy = sid->down.dy;
                             ox = -sid->down.dx;

-- 

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d

Reply via email to