diff --git a/mobile/android/base/ui/Axis.java b/mobile/android/base/ui/Axis.java index f9896248233b..98fc969001a4 100644 --- a/mobile/android/base/ui/Axis.java +++ b/mobile/android/base/ui/Axis.java @@ -185,7 +185,12 @@ abstract class Axis { */ float getEdgeResistance() { float excess = getExcess(); - return (excess > 0.0f) ? SNAP_LIMIT - excess / getViewportLength() : 1.0f; + if (excess > 0.0f) { + // excess can be greater than viewport length, but the resistance + // must never drop below 0.0 + return Math.max(0.0f, SNAP_LIMIT - excess / getViewportLength()); + } + return 1.0f; } /* Returns the velocity. If the axis is locked, returns 0. */