mchoe / SwiftSVG

A simple, performant, and lightweight SVG parser
Other
1.92k stars 230 forks source link

Multiple commands MoveTo #160

Open Luostari opened 4 years ago

Luostari commented 4 years ago

Hi! I found an issue. If we have a path d="m50,50 200,0 m0,200 -200,0" algorithm draws three lines instead of two like it should do because the third command MoveTo is explicit and cannot be treated like LineTo. I fixed this by returning the previous command from the function execute, as it may change inside the function. Also, I changed Unit Tests and created a new one for this case.