forked from enlightenment/efl
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
This commit is contained in:
parent
12711f6f63
commit
051d092c71
|
@ -678,8 +678,8 @@ static Eina_Bool
|
||||||
_smart_bounce_x_animator(void *data)
|
_smart_bounce_x_animator(void *data)
|
||||||
{
|
{
|
||||||
Smart_Data *sd;
|
Smart_Data *sd;
|
||||||
Evas_Coord x, y, dx;
|
Evas_Coord x, y, dx, w, odx;
|
||||||
double t, p, dt;
|
double t, p, dt, pd;
|
||||||
|
|
||||||
sd = data;
|
sd = data;
|
||||||
t = ecore_loop_time_get();
|
t = ecore_loop_time_get();
|
||||||
|
@ -687,11 +687,19 @@ _smart_bounce_x_animator(void *data)
|
||||||
if (dt >= 0.0)
|
if (dt >= 0.0)
|
||||||
{
|
{
|
||||||
dt = dt / _elm_config->thumbscroll_bounce_friction;
|
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;
|
if (dt > 1.0) dt = 1.0;
|
||||||
p = 1.0 - ((1.0 - dt) * (1.0 - dt));
|
p = 1.0 - ((1.0 - dt) * (1.0 - dt));
|
||||||
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
|
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
|
||||||
dx = sd->down.b2x - sd->down.bx;
|
dx = (odx * p);
|
||||||
dx = (dx * p);
|
|
||||||
x = sd->down.bx + dx;
|
x = sd->down.bx + dx;
|
||||||
if (!sd->down.cancelled)
|
if (!sd->down.cancelled)
|
||||||
elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
|
elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
|
||||||
|
@ -718,8 +726,8 @@ static Eina_Bool
|
||||||
_smart_bounce_y_animator(void *data)
|
_smart_bounce_y_animator(void *data)
|
||||||
{
|
{
|
||||||
Smart_Data *sd;
|
Smart_Data *sd;
|
||||||
Evas_Coord x, y, dy;
|
Evas_Coord x, y, dy, h, ody;
|
||||||
double t, p, dt;
|
double t, p, dt, pd;
|
||||||
|
|
||||||
sd = data;
|
sd = data;
|
||||||
t = ecore_loop_time_get();
|
t = ecore_loop_time_get();
|
||||||
|
@ -727,11 +735,19 @@ _smart_bounce_y_animator(void *data)
|
||||||
if (dt >= 0.0)
|
if (dt >= 0.0)
|
||||||
{
|
{
|
||||||
dt = dt / _elm_config->thumbscroll_bounce_friction;
|
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;
|
if (dt > 1.0) dt = 1.0;
|
||||||
p = 1.0 - ((1.0 - dt) * (1.0 - dt));
|
p = 1.0 - ((1.0 - dt) * (1.0 - dt));
|
||||||
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
|
elm_smart_scroller_child_pos_get(sd->smart_obj, &x, &y);
|
||||||
dy = sd->down.b2y - sd->down.by;
|
dy = (ody * p);
|
||||||
dy = (dy * p);
|
|
||||||
y = sd->down.by + dy;
|
y = sd->down.by + dy;
|
||||||
if (!sd->down.cancelled)
|
if (!sd->down.cancelled)
|
||||||
elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
|
elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
|
||||||
|
|
Loading…
Reference in New Issue