From 820616b42aecca58cc71fb15e8b643c7472e8134 Mon Sep 17 00:00:00 2001 From: Will Calderbank Date: Wed, 29 Aug 2018 17:35:55 +0100 Subject: [PATCH] Fix #114 maxFlingDuration not being taken into account --- lib/ftscroller.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ftscroller.js b/lib/ftscroller.js index dfa7a68..5b7a522 100644 --- a/lib/ftscroller.js +++ b/lib/ftscroller.js @@ -1067,8 +1067,7 @@ var FTScroller, CubicBezier; { duration } = log( { speed } / { initial speed } ) / log( { friction } ) */ - flingDuration = Math.log(_kMinimumSpeed / Math.abs(movementSpeed)) / Math.log(_kFriction); - + flingDuration = Math.min(_instanceOptions.maxFlingDuration, Math.log(_kMinimumSpeed / Math.abs(movementSpeed)) / Math.log(_kFriction)); /* Calculate the fling distance (before any bouncing or snapping). As per TouchScroll, the total distance covered can be approximated by summing