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

More marker fixes #307

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

More marker fixes #307

wants to merge 10 commits into from

Conversation

SilverCardioid
Copy link
Contributor

Following on from my previous PR, I've been working on-and-off on getting the orientation of markers correct, as well as fixing some of their types and sizes. As this is a bigger change than I anticipated, I've made a set of testcases to compare the results of the current repo and my fork on a few test SVGs (the before-and-afters being 'Kozea' and 'AgC/master' in the middle column).

A possible breaking change: instead of different sub-paths being separated by a None in node.vertices, the sub-paths are now in nested lists within the array. A new sub-list is added to vertices for every M or m, and coordinates and angles are appended to the last sub-list instead of the main array. This makes it easier for draw_markers() to handle the difference between closed and unclosed sub-paths, as the former should take the angle of the closing segment into account. I'm hoping the array isn't used in other places (within the library or elsewhere) in a way that would be broken by this change.

The diff within the draw_markers() function may not seem that useful, since the main loop has been indented an additional level and the GitHub interface doesn't seem to have the option to ignore whitespace differences like some other tools do. The only parts that have changed there are the determination of the position and angle (lines 32–61 and 131 in the new file), and the size calculation at lines 84–95.

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.

1 participant