mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 716673 - Collapse unused WAITING_TO_SNAP and SNAPPING flingstates into STOPPED. r=pcwalton
This commit is contained in:
parent
ce93ccd236
commit
78ab72ec22
@ -464,7 +464,6 @@ public class PanZoomController
|
||||
}
|
||||
|
||||
mState = PanZoomState.FLING;
|
||||
mX.setFlingState(Axis.FlingStates.SNAPPING); mY.setFlingState(Axis.FlingStates.SNAPPING);
|
||||
Log.d(LOGTAG, "end bounce at " + metrics);
|
||||
|
||||
startAnimationTimer(new BounceRunnable(bounceStartMetrics, metrics));
|
||||
@ -690,8 +689,6 @@ public class PanZoomController
|
||||
STOPPED,
|
||||
PANNING,
|
||||
FLINGING,
|
||||
WAITING_TO_SNAP,
|
||||
SNAPPING,
|
||||
}
|
||||
|
||||
public enum Overscroll {
|
||||
@ -716,10 +713,7 @@ public class PanZoomController
|
||||
|
||||
public float displacement;
|
||||
|
||||
private int mSnapFrame;
|
||||
private float mSnapPos, mSnapEndPos;
|
||||
|
||||
public Axis() { mSnapFrame = -1; }
|
||||
public Axis() {}
|
||||
|
||||
public FlingStates getFlingState() { return mFlingState; }
|
||||
|
||||
@ -808,15 +802,11 @@ public class PanZoomController
|
||||
}
|
||||
|
||||
public void startFling(boolean stopped) {
|
||||
if (!stopped) {
|
||||
setFlingState(FlingStates.FLINGING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (disableSnap || FloatUtils.fuzzyEquals(getExcess(), 0.0f))
|
||||
if (stopped) {
|
||||
setFlingState(FlingStates.STOPPED);
|
||||
else
|
||||
setFlingState(FlingStates.WAITING_TO_SNAP);
|
||||
} else {
|
||||
setFlingState(FlingStates.FLINGING);
|
||||
}
|
||||
}
|
||||
|
||||
/* Advances a fling animation by one step. */
|
||||
@ -847,7 +837,7 @@ public class PanZoomController
|
||||
|
||||
if (Math.abs(velocity) < 0.3f) {
|
||||
velocity = 0.0f;
|
||||
setFlingState(FlingStates.WAITING_TO_SNAP);
|
||||
setFlingState(FlingStates.STOPPED);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user