From: 김재환 <jae.hwan.kim@samsung.com>

Subject: [E-devel] [Patch] els_scroller - Cannot click even if it
reach to end

I have another issue in scroller when the bounce is off.
Scroller cannot be clicked even if it reach to edge and animation is
end.
The reason is why the momentum animation is running even if it reach
end and bounce animation is off.
So I change the code that if it reach the edge in case of bounce-off,
the momentum animation is stoped.
The following is the patch code.




SVN revision: 56580
This commit is contained in:
김재환 2011-01-31 10:13:40 +00:00 committed by Carsten Haitzler
parent 1bfd549a08
commit d63a0cb003
1 changed files with 13 additions and 1 deletions

View File

@ -692,6 +692,7 @@ _smart_momentum_animator(void *data)
Smart_Data *sd;
double t, dt, p;
Evas_Coord x, y, dx, dy, px, py, maxx, maxy, minx, miny;
Eina_Bool no_bounce_x_end = EINA_FALSE, no_bounce_y_end = EINA_FALSE;
sd = data;
t = ecore_loop_time_get();
@ -740,8 +741,19 @@ _smart_momentum_animator(void *data)
elm_smart_scroller_child_pos_set(sd->smart_obj, x, y);
sd->pan_func.max_get(sd->pan_obj, &maxx, &maxy);
sd->pan_func.min_get(sd->pan_obj, &minx, &miny);
if (!sd->bounce_horiz)
{
if (x <= minx) no_bounce_x_end = EINA_TRUE;
if ((x - minx) >= maxx) no_bounce_x_end = EINA_TRUE;
}
if (!sd->bounce_vert)
{
if (y <= miny) no_bounce_y_end = EINA_TRUE;
if ((y - miny) >= maxy) no_bounce_y_end = EINA_TRUE;
}
if ((dt >= 1.0) ||
((sd->down.bounce_x_hold) && (sd->down.bounce_y_hold)))
((sd->down.bounce_x_hold) && (sd->down.bounce_y_hold)) ||
(no_bounce_x_end && no_bounce_y_end))
{
_smart_anim_stop(sd->smart_obj);
sd->down.momentum_animator = NULL;