panzoom icon indicating copy to clipboard operation
panzoom copied to clipboard

Possible to increase friction for momentum panning?

Open bard opened this issue 3 years ago • 1 comments

The smoothScroll behavior looks quite different than e.g. scrolling on a touch device, in that the area that moving area takes longer to come to rest.

Without resorting to setting smoothScroll: false, which would make movement stop immediately, I would like to make it stop sooner, as if the hypothetical surface on which the movement is happening had higher friction.

I've played with the amplitude and minVelocity settings for kinetic (admittedly, without understanding them), but wasn't able to achieve it. Is there a other way?

bard avatar Aug 02 '21 15:08 bard

I know this is a late reply but I found a solution that will work.

In the kinetic portion of the code try lowering the timeConstant variable.

var timeConstant = 342;

150 was the sweet spot for my liking.

DevDavey avatar Jan 28 '22 06:01 DevDavey