efl_ui/scroll_manager: make scroll direction changes more responsive with wheel

Summary:
if the wheel event being processed is in a different direction than the
existing scroll animation, drop the previous animation and immediately
begin scrolling in the opposite direciton

fix T8052

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8052

Differential Revision: https://phab.enlightenment.org/D9806
This commit is contained in:
Mike Blumenkrantz 2019-09-03 09:28:11 +02:00 committed by Xavi Artigas
parent 6771ef63a2
commit 98da00cfd2
1 changed files with 10 additions and 2 deletions

View File

@ -791,8 +791,16 @@ _scroll_wheel_post_event_cb(void *data, Evas *e EINA_UNUSED)
cur = efl_ui_pan_position_get(sd->pan_obj);
x = cur.x;
y = cur.y;
if (sd->scrollto.x.animator) x = sd->scrollto.x.end;
if (sd->scrollto.y.animator) y = sd->scrollto.y.end;
if (sd->scrollto.x.animator)
{
if (((ev->z > 0) && (sd->scrollto.x.end > x)) || ((ev->z < 0) && (sd->scrollto.x.end < x)))
x = sd->scrollto.x.end;
}
if (sd->scrollto.y.animator)
{
if (((ev->z > 0) && (sd->scrollto.y.end > y)) || ((ev->z < 0) && (sd->scrollto.y.end < y)))
y = sd->scrollto.y.end;
}
max = efl_ui_pan_position_max_get(sd->pan_obj);
min = efl_ui_pan_position_min_get(sd->pan_obj);
if (x < min.x) x = min.x;