bodoni / svg

Composer and parser for SVG
Other
302 stars 44 forks source link

Fix arc command parsing to respect optional whitespace around flag params #36

Closed mlwilkerson closed 3 years ago

mlwilkerson commented 3 years ago

According to the grammar for flag params the white space between the flags is optional. The only way to account for this in the current parsing algorithm seems to be to add some additional context when reading parameters to know when we're parsing an EllipticalArc command, and then when we're on either the 4th or 5th param, whose type should be understood as a flag, rather than a number, and parsed according to the optional nature of the adjacent whitespace.

This PR is one way to do that and includes test coverage of relevant cases.

IvanUkhov commented 3 years ago

I totally forgot about this pull request. Sorry about that. Thank you for contributing!