Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a problem in the svg duplicate line culling #116

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

trapgate
Copy link

@trapgate trapgate commented Jan 5, 2021

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

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 scottbez1#115
@trapgate
Copy link
Author

trapgate commented Jan 5, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The duplicate svg line removal code has a problem
1 participant