mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 05:35:31 +00:00
Bug 709817 - Don't clobber mState if animations are aborted. r=pcwalton
Ensure that if the animation is aborted by changing the value of mState (such as if we get an onTouchStart and set the mState to TOUCHING), then we don't clobber it and set it back to NOTHING. Only set it back to NOTHING when the animation finishes normally.
This commit is contained in:
parent
cc417ad0e7
commit
6d82dbf388
@ -617,6 +617,7 @@ public class PanZoomController
|
||||
/* Finally, if there's nothing else to do, complete the animation and go to sleep. */
|
||||
finishBounce();
|
||||
finishAnimation();
|
||||
mState = PanZoomState.NOTHING;
|
||||
}
|
||||
|
||||
/* Performs one frame of a bounce animation. */
|
||||
@ -684,16 +685,17 @@ public class PanZoomController
|
||||
*/
|
||||
boolean overscrolledX = mX.getOverscroll() != Axis.Overscroll.NONE;
|
||||
boolean overscrolledY = mY.getOverscroll() != Axis.Overscroll.NONE;
|
||||
if (!mOverridePanning && (overscrolledX || overscrolledY))
|
||||
if (!mOverridePanning && (overscrolledX || overscrolledY)) {
|
||||
bounce();
|
||||
else
|
||||
} else {
|
||||
finishAnimation();
|
||||
mState = PanZoomState.NOTHING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void finishAnimation() {
|
||||
Log.d(LOGTAG, "Finishing animation at " + mController.getViewportMetrics());
|
||||
mState = PanZoomState.NOTHING;
|
||||
stopAnimationTimer();
|
||||
|
||||
// Force a viewport synchronisation
|
||||
|
Loading…
Reference in New Issue
Block a user