Skip to content

Commit a54a914

Browse files
Merge pull request #1 from willcalderbank/develop
Fix ftlabs#114 maxFlingDuration not being taken into account
2 parents 4a0fc60 + 820616b commit a54a914

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/ftscroller.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,7 @@ var FTScroller, CubicBezier;
10671067
{ duration } = log( { speed } / { initial speed } ) / log( { friction } )
10681068
*/
10691069

1070-
flingDuration = Math.log(_kMinimumSpeed / Math.abs(movementSpeed)) / Math.log(_kFriction);
1071-
1070+
flingDuration = Math.min(_instanceOptions.maxFlingDuration, Math.log(_kMinimumSpeed / Math.abs(movementSpeed)) / Math.log(_kFriction));
10721071

10731072
/* Calculate the fling distance (before any bouncing or snapping). As per
10741073
TouchScroll, the total distance covered can be approximated by summing

0 commit comments

Comments
 (0)