Fix infinite animation on fling from diagonal overscroll.
This CL fixes an issue where in if a user flings the scroller while diagonally overscrolled, the scroller never comes out of the overscroll and instead, plays a forward animation that takes the scroller to the end. This happens because ElasticOverscrollController::Animate keeps supplying zero time deltas to StretchAmountForTimeDelta and that leads to the animation never ending. The time deltas are zero due to momentum_animation_reset_at_next_frame_ wrongly getting reset every frame while diagonally overscrolled. The comment for momentum_animation_reset_at_next_frame_ claims that it was put in place to handle programmatic scrolls while overscrolled. However, after deleting this code and doing some tests, I don't see any difference in how programmatic scrolls are handled while overscrolled. This is code was carried over as a part of the overscroll refactor (crrev.com/c/2231254). The code was originally at least 5 years old and seems to be no longer needed. Getting rid of the code fixes the bug too. Bug: 1122482 Change-Id: Idb78a735d023e40151fba4a69e2191d1117cf95a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377235 Commit-Queue: Rahul Arakeri <arakeri@microsoft.com> Reviewed-by:Robert Flack <flackr@chromium.org> Cr-Commit-Position: refs/heads/master@{#812975}
Showing
Please register or sign in to comment