зеркало из https://github.com/mozilla/gecko-dev.git
b=767710 don't let additional events with the same destination restart smooth scrolling r=mstange
--HG-- extra : transplant_source : _%BA%CE%F1A%B7%40N%14VMZ%1D%2C%98Lg%40%F7%AF
This commit is contained in:
Родитель
61fd583b40
Коммит
0b5112e494
|
@ -1345,15 +1345,23 @@ nsGfxScrollFrameInner::AsyncScroll::InitSmoothScroll(TimeStamp aTime,
|
|||
nsPoint aDestination,
|
||||
nsIAtom *aOrigin,
|
||||
const nsRect& aRange) {
|
||||
mRange = aRange;
|
||||
TimeDuration duration = CalcDurationForEventTime(aTime, aOrigin);
|
||||
nsSize currentVelocity(0, 0);
|
||||
if (!mIsFirstIteration) {
|
||||
// If an additional event has not changed the destination, then do not let
|
||||
// another minimum duration reset slow things down. If it would then
|
||||
// instead continue with the existing timing function.
|
||||
if (aDestination == mDestination &&
|
||||
aTime + duration > mStartTime + mDuration)
|
||||
return;
|
||||
|
||||
currentVelocity = VelocityAt(aTime);
|
||||
mStartPos = PositionAt(aTime);
|
||||
}
|
||||
mStartTime = aTime;
|
||||
mDuration = CalcDurationForEventTime(aTime, aOrigin);
|
||||
mDuration = duration;
|
||||
mDestination = aDestination;
|
||||
mRange = aRange;
|
||||
InitTimingFunction(mTimingFunctionX, mStartPos.x, currentVelocity.width,
|
||||
aDestination.x);
|
||||
InitTimingFunction(mTimingFunctionY, mStartPos.y, currentVelocity.height,
|
||||
|
|
Загрузка…
Ссылка в новой задаче