Closed chethaase closed 1 year ago
We could add this, the info is available internally. It would only be an issue when a path contains conic segments: we want to convert them to cubic which would affect the total count.
Done, added in 0.6.0. I added rawSize
and size
. The former returns the segment count without any conversion (conic->quadratic) and is fast, the second one returns the exact number of segments to iterate taking into account conversions, but is more expensive.
In using the iterator API, I'm finding myself wanting to know how many commands there are in a path, so I can pre-allocate structures based on that info. Not sure if that API belongs on PathIterator or some other queryable object, but seems like an API that might be useful in general.