Change the scroll animation distance to be proportional to sine curve.
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Tue, 2 Jul 2013 11:27:33 +0000 (20:27 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Thu, 4 Jul 2013 07:36:38 +0000 (16:36 +0900)
Change-Id: I9ed72f2ca522421020016f31ad68645c40519708

Conflicts:

src/lib/elm_interface_scrollable.c

config/mobile/base.src
src/lib/elm_interface_scrollable.c

index 913f520..4280f79 100644 (file)
@@ -7,7 +7,7 @@ group "Elm_Config" struct {
   value "thumbscroll_hold_threshold" int: 100;
   value "thumbscroll_momentum_threshold" double: 100.0;
   value "thumbscroll_friction" double: 1.5;
-  value "thumbscroll_min_friction" double: 0.1;
+  value "thumbscroll_min_friction" double: 0.3;
   value "thumbscroll_friction_standard" double: 3500.0;
   value "thumbscroll_bounce_friction" double: 0.5;
   value "thumbscroll_bounce_enable" uchar: 0;
index 35e8784..43ac592 100644 (file)
@@ -2264,9 +2264,28 @@ _elm_scroll_mouse_up_event_cb(void *data,
                        if ((_elm_config->thumbscroll_friction > 0.0) &&
                            (vel > _elm_config->thumbscroll_momentum_threshold))
                          {
-                            sid->down.dx = ((double)dx / at);
-                            sid->down.dy = ((double)dy / at);
+                            Evas_Coord vw, vh, aw, ah;
+                            int minx, miny, mx, my, px, py;
+                            double tt = 0.0, dtt = 0.0;
                             sid->down.extra_time = 0.0;
+
+                            psd->api->pos_min_get
+                              (sid->pan_obj, &minx, &miny);
+                            psd->api->pos_max_get(sid->pan_obj, &mx, &my);
+                            psd->api->pos_get(sid->pan_obj, &px, &py);
+                            _elm_scroll_content_viewport_size_get(sid->obj, &vw, &vh);
+                            if (dx > 0)
+                              sid->down.dx = (sin((M_PI * (double)dx / vw)
+                                                  - (M_PI / 2)) + 1) * vw / at;
+                            else
+                              sid->down.dx = (sin((M_PI * (double)dx / vw)
+                                                  + (M_PI / 2)) - 1) * vw / at;
+                            if (dy > 0)
+                              sid->down.dy = (sin((M_PI * (double)dy / vh)
+                                                  - (M_PI / 2)) + 1) * vh / at;
+                            else
+                              sid->down.dy = (sin((M_PI * (double)dy / vh)
+                                                  + (M_PI / 2)) - 1) * vh / at;
                             sid->down.pdx = sid->down.dx;
                             sid->down.pdy = sid->down.dy;
                             ox = -sid->down.dx;