Bug 711453 - Avoid potentially corrupting the fling velocity. r=pcwalton

This commit is contained in:
Kartikaya Gupta 2011-12-19 09:26:41 -05:00
parent 1925b6adfa
commit 0b7c833306

View File

@ -402,6 +402,12 @@ public class PanZoomController
}
private void track(float x, float y, float lastX, float lastY, float timeDelta) {
if (FloatUtils.fuzzyEquals(timeDelta, 0)) {
// probably a duplicate event, ignore it. using a zero timeDelta will mess
// up our velocity
return;
}
if (mState == PanZoomState.PANNING_LOCKED) {
// check to see if we should break the axis lock
double angle = Math.atan2(y - mY.firstTouchPos, x - mX.firstTouchPos); // range [-pi, pi]