diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-09-03 09:28:11 +0200 |
---|---|---|
committer | Xavi Artigas <xavierartigas@yahoo.es> | 2019-09-03 09:35:36 +0200 |
commit | 98da00cfd2b69e738ccc9b37ea7ff9a0304aee7d (patch) | |
tree | 781eb2a2582e5f059beb8faf224506288583d166 | |
parent | 6771ef63a28f8fd5d332f7beaa948bb496a1a8ea (diff) | |
download | efl-98da00cfd2b69e738ccc9b37ea7ff9a0304aee7d.tar.gz |
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
-rw-r--r-- | src/lib/elementary/efl_ui_scroll_manager.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_scroll_manager.c b/src/lib/elementary/efl_ui_scroll_manager.c index bc6ca2412a..7bf0a1dd1a 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.c +++ b/src/lib/elementary/efl_ui_scroll_manager.c @@ -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; |