mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1019999 - Clear overscroll if snap-back animation is cancelled. r=kats
--HG-- extra : source : 20ace5785615d1cc7d0edbe7e09f8691166c6166
This commit is contained in:
parent
0ae54304d5
commit
fc6ec3cd46
@ -505,6 +505,16 @@ public:
|
||||
return continueX || continueY;
|
||||
}
|
||||
|
||||
virtual void Cancel() MOZ_OVERRIDE
|
||||
{
|
||||
// If the snap-back animation is cancelled for some reason, we need to
|
||||
// clear the overscroll, otherwise the user would be stuck in the
|
||||
// overscrolled state (since touch blocks beginning in an overscrolled
|
||||
// state are ignored).
|
||||
mApzc.mX.ClearOverscroll();
|
||||
mApzc.mY.ClearOverscroll();
|
||||
}
|
||||
|
||||
private:
|
||||
AsyncPanZoomController& mApzc;
|
||||
};
|
||||
@ -1684,7 +1694,12 @@ void AsyncPanZoomController::StartAnimation(AsyncPanZoomAnimation* aAnimation)
|
||||
void AsyncPanZoomController::CancelAnimation() {
|
||||
ReentrantMonitorAutoEnter lock(mMonitor);
|
||||
SetState(NOTHING);
|
||||
mAnimation = nullptr;
|
||||
if (mAnimation) {
|
||||
mAnimation->Cancel();
|
||||
mAnimation = nullptr;
|
||||
// mAnimation->Cancel() may have done something that requires a repaint.
|
||||
RequestContentRepaint();
|
||||
}
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::SetCompositorParent(CompositorParent* aCompositorParent) {
|
||||
|
@ -1032,6 +1032,9 @@ public:
|
||||
virtual bool Sample(FrameMetrics& aFrameMetrics,
|
||||
const TimeDuration& aDelta) = 0;
|
||||
|
||||
// Called if the animation is cancelled before it ends.
|
||||
virtual void Cancel() {}
|
||||
|
||||
/**
|
||||
* Get the deferred tasks in |mDeferredTasks|. See |mDeferredTasks|
|
||||
* for more information.
|
||||
|
@ -177,6 +177,10 @@ bool Axis::IsOverscrolled() const {
|
||||
return mOverscroll != 0;
|
||||
}
|
||||
|
||||
void Axis::ClearOverscroll() {
|
||||
mOverscroll = 0;
|
||||
}
|
||||
|
||||
float Axis::PanDistance() {
|
||||
return fabsf(mPos - mStartPos);
|
||||
}
|
||||
|
@ -109,6 +109,11 @@ public:
|
||||
*/
|
||||
bool IsOverscrolled() const;
|
||||
|
||||
/**
|
||||
* Clear any overscroll amount on this axis.
|
||||
*/
|
||||
void ClearOverscroll();
|
||||
|
||||
/**
|
||||
* Gets the distance between the starting position of the touch supplied in
|
||||
* startTouch() and the current touch from the last
|
||||
|
Loading…
Reference in New Issue
Block a user