Bug 1208554 - Take Velocity into account for WheelScrollAnimations. r=kats

This commit is contained in:
Mason Chang 2015-09-28 17:07:06 -07:00
parent aaced06a5b
commit da76d27ffa

View File

@ -53,6 +53,14 @@ WheelScrollAnimation::DoSample(FrameMetrics& aFrameMetrics, const TimeDuration&
ParentLayerPoint displacement =
(CSSPoint::FromAppUnits(sampledDest) - aFrameMetrics.GetScrollOffset()) * zoom;
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.
ParentLayerPoint adjustedOffset, overscroll;
mApzc.mX.AdjustDisplacement(displacement.x, adjustedOffset.x, overscroll.x);