mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1208554 - Take Velocity into account for WheelScrollAnimations. r=kats
This commit is contained in:
parent
aaced06a5b
commit
da76d27ffa
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user