jzbrooks / vgo

vector graphic optimization
MIT License
43 stars 2 forks source link

Fix a rare crash involving subpath relativity #57

Closed jzbrooks closed 3 months ago

jzbrooks commented 3 months ago

This is super important for calculating relative coordinates for a given subpath and it was totally wrong in a couple spots.

If a "closepath" is followed immediately by a "moveto", then the "moveto" identifies the start point of the next subpath. If a "closepath" is followed immediately by any other command, then the next subpath starts at the same initial point as the current subpath.

https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand