mathandy / svgpathtools

A collection of tools for manipulating and analyzing SVG Path objects and Bezier curves.
MIT License
558 stars 142 forks source link

Fix Issue #99 #115

Closed tatarize closed 4 years ago

tatarize commented 4 years ago

Issue #99 is caused when compound S commands fail to set the last_command to S. If an S command contains more than one S. The behavior of the smooth curve changes. The first S command is coincident with the current point. However, the second S command is the reflection of the previous control point. The current state of the code only updates the last_command when we change command, which means last_command remains set to M and the behavior remains set to coincident to the current point.

This is also corrected in regebro/svg.path#17 and the source is merely modified to reflect the current state of the svg.path parser (Close and Move pathsegments notwithstanding).

Test coverage is added to prove the functionality of this correction.