Skip to content
This repository was archived by the owner on Jun 9, 2022. It is now read-only.

Fix #114 maxFlingDuration not being taken into account #115

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/ftscroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down