rveciana / svg-path-properties

Pure Javascript alternative to path.getPointAtLength(t) and getTotalLength() functions. Works with Canvas & Node
MIT License
256 stars 22 forks source link

getTotalLength() == Infinity due to float precision #61

Closed scien closed 1 year ago

scien commented 1 year ago

The following paths will cause getTotalLength() to return Infinity.

It ends up using getQuadraticArcLength() in bezier-functions.

In example 1 ("Q 0 0 267 0 Q 391 0 512 0"), we get the following: