Summary:
Evas_Coord is a regular int, so this will overflow easily for large
scrollers and return NaN for scroll duration and break the scroll
Reviewers: segfaultxavi
Reviewed By: segfaultxavi
Subscribers: segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9355
_scroll_manager_animation_duration_get(Evas_Coord dx, Evas_Coord dy)
{
double dist = 0.0, vel = 0.0, dur = 0.0;
- dist = sqrt(dx * dx + dy *dy);
+ uint64_t x = abs(dx), y = abs(dy);
+ dist = sqrt(x * x + y * y);
vel = _elm_config->thumbscroll_friction_standard / _elm_config->thumbscroll_friction;
dur = dist / vel;
dur = (dur > _elm_config->thumbscroll_friction) ? _elm_config->thumbscroll_friction : dur;