Dear all
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.
Please check the attached patch file.
Thanks.
--
Jaehwan Kim.
Index: src/lib/els_scroller.c
===================================================================
--- src/lib/els_scroller.c (revision 64374)
+++ src/lib/els_scroller.c (work copy)
@@ -674,8 +674,8 @@ static Eina_Bool
_smart_bounce_x_animator(void *data)
{
Smart_Data *sd;
- Evas_Coord x, y, dx;
- double t, p, dt;
+ Evas_Coord x, y, dx, w, odx;
+ double t, p, dt, pd;
sd = data;
t = ecore_loop_time_get();
@@ -683,11 +683,19 @@ _smart_bounce_x_animator(void *data)
if (dt >= 0.0)
{
dt = dt / _elm_config->thumbscroll_bounce_friction;
+ odx = sd->down.b2x - sd->down.bx;
+ elm_smart_scroller_child_viewport_size_get(sd->smart_obj, &w, NULL);
+ if (!sd->down.momentum_animator && (w > abs(odx)))
+ {
+ pd = (double)odx / (double)w;
+ pd = (pd > 0) ? pd : -pd;
+ pd = 1.0 - ((1.0 - pd) * (1.0 - pd));
+ dt = dt / pd;
+ }
if (dt > 1.0) dt = 1.0;
p = 1.0 - ((1.0 - dt) * (1.0 - dt));
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
- dx = sd->down.b2x - sd->down.bx;
- dx = (dx * p);
+ dx = (odx * p);
x = sd->down.bx + dx;
if (!sd->down.cancelled)
elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
@@ -714,8 +722,8 @@ static Eina_Bool
_smart_bounce_y_animator(void *data)
{
Smart_Data *sd;
- Evas_Coord x, y, dy;
- double t, p, dt;
+ Evas_Coord x, y, dy, h, ody;
+ double t, p, dt, pd;
sd = data;
t = ecore_loop_time_get();
@@ -723,11 +731,19 @@ _smart_bounce_y_animator(void *data)
if (dt >= 0.0)
{
dt = dt / _elm_config->thumbscroll_bounce_friction;
+ ody = sd->down.b2y - sd->down.by;
+ elm_smart_scroller_child_viewport_size_get(sd->smart_obj, NULL, &h);
+ if (!sd->down.momentum_animator && (h > abs(ody)))
+ {
+ pd = (double)ody / (double)h;
+ pd = (pd > 0) ? pd : -pd;
+ pd = 1.0 - ((1.0 - pd) * (1.0 - pd));
+ dt = dt / pd;
+ }
if (dt > 1.0) dt = 1.0;
p = 1.0 - ((1.0 - dt) * (1.0 - dt));
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
- dy = sd->down.b2y - sd->down.by;
- dy = (dy * p);
+ dy = (ody * p);
y = sd->down.by + dy;
if (!sd->down.cancelled)
elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel