summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorJaehwan Kim <jaehwan.kim.neo@gmail.com>2011-10-26 06:30:07 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-10-26 06:30:07 +0000
commit051d092c7161aff3a14eee2563e082e50a79b873 (patch)
tree305cbab793cd4ebb9e82e809a630584c2c0664a9 /legacy
parent12711f6f63ae734e4024bee933a532e177362d3c (diff)
From: Jaehwan Kim <jaehwan.kim.neo@gmail.com>
At first, try to execute elementary_test and drag down the list for bounce. Then as soon as release the mouse, click the list continuously and fast. The list will not be clicked because it cannot be clicked during the bounce animation. The bounce animation time is fixed and it is reset again, when the mouse is down and up. In the result, if we click it continuously, we can not choose the list item. (During animation, list can not be clicked). I changed the function "_smart_bounce_x_animator" and "_smart_bounce_ y_animator". I fixed the bounce time will be changed by remaining distance. SVN revision: 64407
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/src/lib/els_scroller.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/legacy/elementary/src/lib/els_scroller.c b/legacy/elementary/src/lib/els_scroller.c
index a769eba0e0..adba33a43b 100644
--- a/legacy/elementary/src/lib/els_scroller.c
+++ b/legacy/elementary/src/lib/els_scroller.c
@@ -678,8 +678,8 @@ static Eina_Bool
678_smart_bounce_x_animator(void *data) 678_smart_bounce_x_animator(void *data)
679{ 679{
680 Smart_Data *sd; 680 Smart_Data *sd;
681 Evas_Coord x, y, dx; 681 Evas_Coord x, y, dx, w, odx;
682 double t, p, dt; 682 double t, p, dt, pd;
683 683
684 sd = data; 684 sd = data;
685 t = ecore_loop_time_get(); 685 t = ecore_loop_time_get();
@@ -687,11 +687,19 @@ _smart_bounce_x_animator(void *data)
687 if (dt >= 0.0) 687 if (dt >= 0.0)
688 { 688 {
689 dt = dt / _elm_config->thumbscroll_bounce_friction; 689 dt = dt / _elm_config->thumbscroll_bounce_friction;
690 odx = sd->down.b2x - sd->down.bx;
691 elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, NULL);
692 if (!sd->down.momentum_animator && (w > abs(odx)))
693 {
694 pd = (double)odx / (double)w;
695 pd = (pd > 0) ? pd : -pd;
696 pd = 1.0 - ((1.0 - pd) * (1.0 - pd));
697 dt = dt / pd;
698 }
690 if (dt > 1.0) dt = 1.0; 699 if (dt > 1.0) dt = 1.0;
691 p = 1.0 - ((1.0 - dt) * (1.0 - dt)); 700 p = 1.0 - ((1.0 - dt) * (1.0 - dt));
692 elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); 701 elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
693 dx = sd->down.b2x - sd->down.bx; 702 dx = (odx * p);
694 dx = (dx * p);
695 x = sd->down.bx + dx; 703 x = sd->down.bx + dx;
696 if (!sd->down.cancelled) 704 if (!sd->down.cancelled)
697 elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); 705 elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
@@ -718,8 +726,8 @@ static Eina_Bool
718_smart_bounce_y_animator(void *data) 726_smart_bounce_y_animator(void *data)
719{ 727{
720 Smart_Data *sd; 728 Smart_Data *sd;
721 Evas_Coord x, y, dy; 729 Evas_Coord x, y, dy, h, ody;
722 double t, p, dt; 730 double t, p, dt, pd;
723 731
724 sd = data; 732 sd = data;
725 t = ecore_loop_time_get(); 733 t = ecore_loop_time_get();
@@ -727,11 +735,19 @@ _smart_bounce_y_animator(void *data)
727 if (dt >= 0.0) 735 if (dt >= 0.0)
728 { 736 {
729 dt = dt / _elm_config->thumbscroll_bounce_friction; 737 dt = dt / _elm_config->thumbscroll_bounce_friction;
738 ody = sd->down.b2y - sd->down.by;
739 elm_smart_scroller_child_viewport_size_get(sd->smart_obj, NULL, &h);
740 if (!sd->down.momentum_animator && (h > abs(ody)))
741 {
742 pd = (double)ody / (double)h;
743 pd = (pd > 0) ? pd : -pd;
744 pd = 1.0 - ((1.0 - pd) * (1.0 - pd));
745 dt = dt / pd;
746 }
730 if (dt > 1.0) dt = 1.0; 747 if (dt > 1.0) dt = 1.0;
731 p = 1.0 - ((1.0 - dt) * (1.0 - dt)); 748 p = 1.0 - ((1.0 - dt) * (1.0 - dt));
732 elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y); 749 elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
733 dy = sd->down.b2y - sd->down.by; 750 dy = (ody * p);
734 dy = (dy * p);
735 y = sd->down.by + dy; 751 y = sd->down.by + dy;
736 if (!sd->down.cancelled) 752 if (!sd->down.cancelled)
737 elm_smart_scroller_child_pos_set(sd->smart_obj, x, y); 753 elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);