Bug 711071 - Check for scrollable in velocity calculations. r=pcwalton
authorWes Johnston <wjohnston@mozilla.com>
Sat, 28 Jan 2012 18:23:45 +0100
changeset 86893 f8282085e2257a7728ded0af5702a9d37d5e38c9
parent 86892 bcaff471b3850653e73a4bb9427475f65d99afac
child 86894 daafac7f7bfaeb6cb6842aad6b5be3834362a09a
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspcwalton
bugs711071
milestone12.0a1
Bug 711071 - Check for scrollable in velocity calculations. r=pcwalton
mobile/android/base/ui/Axis.java
--- a/mobile/android/base/ui/Axis.java
+++ b/mobile/android/base/ui/Axis.java
@@ -185,17 +185,17 @@ abstract class Axis {
      */
     float getEdgeResistance() {
         float excess = getExcess();
         return (excess > 0.0f) ? SNAP_LIMIT - excess / getViewportLength() : 1.0f;
     }
 
     /* Returns the velocity. If the axis is locked, returns 0. */
     float getRealVelocity() {
-        return mLocked ? 0.0f : mVelocity;
+        return (mLocked || !scrollable()) ? 0.0f : mVelocity;
     }
 
     void startPan() {
         mFlingState = FlingStates.PANNING;
     }
 
     void startFling(boolean stopped) {
         mDisableSnap = mSubscroller.scrolling();