jaehwan pushed a commit to branch master.

commit 51798c4bb19c096be36c2e233f0f30807a756ca2
Author: Jaehwan Kim <[email protected]>
Date:   Wed Jul 3 19:25:24 2013 +0900

    If the flick distance is more than thumbscroll_flick_distance_tolerance, it 
become same with thumbscroll_flick_distance_tolerance.
---
 src/lib/elm_interface_scrollable.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/src/lib/elm_interface_scrollable.c 
b/src/lib/elm_interface_scrollable.c
index 69e3025..ac92ea9 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -2413,17 +2413,29 @@ _elm_scroll_mouse_up_event_cb(void *data,
                                   
elm_scrollable_interface_content_viewport_size_get(&vw, &vh));
                             max_d = 
_elm_config->thumbscroll_flick_distance_tolerance;
                             if (dx > 0)
-                              sid->down.dx = (sin((M_PI * (double)dx / max_d)
-                                                  - (M_PI / 2)) + 1) * max_d / 
at;
+                              {
+                                 if (dx > max_d) dx = max_d;
+                                 sid->down.dx = (sin((M_PI * (double)dx / 
max_d)
+                                                     - (M_PI / 2)) + 1) * 
max_d / at;
+                              }
                             else
-                              sid->down.dx = (sin((M_PI * (double)dx / max_d)
-                                                  + (M_PI / 2)) - 1) * max_d / 
at;
+                              {
+                                 if (dx < -max_d) dx = -max_d;
+                                 sid->down.dx = (sin((M_PI * (double)dx / 
max_d)
+                                                     + (M_PI / 2)) - 1) * 
max_d / at;
+                              }
                             if (dy > 0)
-                              sid->down.dy = (sin((M_PI * (double)dy / max_d)
-                                                  - (M_PI / 2)) + 1) * max_d / 
at;
+                              {
+                                 if (dy > max_d) dy = max_d;
+                                 sid->down.dy = (sin((M_PI * (double)dy / 
max_d)
+                                                     - (M_PI / 2)) + 1) * 
max_d / at;
+                              }
                             else
-                              sid->down.dy = (sin((M_PI * (double)dy / max_d)
-                                                  + (M_PI / 2)) - 1) * max_d / 
at;
+                              {
+                                 if (dy < -max_d) dy = -max_d;
+                                 sid->down.dy = (sin((M_PI * (double)dy / 
max_d)
+                                                     + (M_PI / 2)) - 1) * 
max_d / at;
+                              }
                             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)) ||

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to