Bug 1269068 - Zero out the axis velocity once the wheel scroll animation is terminating. r?botond
MozReview-Commit-ID: 50WX2ATswhv
--- a/gfx/layers/apz/src/WheelScrollAnimation.cpp
+++ b/gfx/layers/apz/src/WheelScrollAnimation.cpp
@@ -50,17 +50,20 @@ WheelScrollAnimation::DoSample(FrameMetr
// function as normal.
bool finished = IsFinished(now);
nsPoint sampledDest = finished
? mDestination
: PositionAt(now);
ParentLayerPoint displacement =
(CSSPoint::FromAppUnits(sampledDest) - aFrameMetrics.GetScrollOffset()) * zoom;
- if (!IsZero(displacement)) {
+ if (finished) {
+ mApzc.mX.SetVelocity(0);
+ mApzc.mY.SetVelocity(0);
+ } else if (!IsZero(displacement)) {
// Velocity is measured in ParentLayerCoords / Milliseconds
float xVelocity = displacement.x / aDelta.ToMilliseconds();
float yVelocity = displacement.y / aDelta.ToMilliseconds();
mApzc.mX.SetVelocity(xVelocity);
mApzc.mY.SetVelocity(yVelocity);
}
// Note: we ignore overscroll for wheel animations.