benjamminf / warpjs

Warp, distort, bend, twist and smudge your SVG’s directly in the browser
https://benjamminf.github.io/warpjs
MIT License
486 stars 34 forks source link

Threshold as a function #10

Closed benjamminf closed 3 years ago

benjamminf commented 7 years ago

A great idea would be to have the threshold value supplied in the interpolate and extrapolate methods accept a function, which will pass the coordinates of the current point, much like the transformer function. This would allow modifying how much interpolation/extrapolation happens based on the location in the SVG.

A use case for this would be for a smudge tool. The threshold should be smaller closer to where the smudge is happening, or just not interpolate past a certain distance.