scottbez1 / splitflap

DIY split-flap display
https://scottbez1.github.io/splitflap
Other
3.09k stars 257 forks source link

fix a problem in the svg duplicate line culling #116

Open trapgate opened 3 years ago

trapgate commented 3 years ago

When culling duplicate lines in the generated svg files, if the path immediately preceding a Close element was pruned, the Close would end up drawing a line from the beginning of the deleted element, rather than the end. This is because even though the svg.path library adds a start and end point to a close instruction, the actual XML representation is just Z, with no coordinates, and it draws a line from the end of the previous line, to the location of the most recent Move. To fix this, this change replaces all Close elements with Lines instead.

Fixes #115

trapgate commented 3 years ago

As @dmadison pointed out in #116, this occurs only when using a newer version of the svg.path library than the one specified in requirements.txt. So this PR only makes sense if you want to move to the newer svg.path version.