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

add support for marker "orient" attribute and the "context-fill" and "context-stroke" values #308

Merged
merged 6 commits into from
Oct 16, 2024

Conversation

Fuzzyma
Copy link
Contributor

@Fuzzyma Fuzzyma commented Sep 10, 2024

I went down the rabbit hole of context-fill and context-stroke and implemented marker orientation so that I can use this lib for my arrow-heads as well :D.
Specs for the context-props is https://svgwg.org/svg2-draft/painting.html#context-paint

This should fix #291 and enable context-paint for markers (and for use as well but I didnt test that one)

Copy link
Member

@HackbrettXXX HackbrettXXX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. The code looks mostly good to me. Please add some test cases.

src/context/referenceshandler.ts Outdated Show resolved Hide resolved
@Fuzzyma
Copy link
Contributor Author

Fuzzyma commented Sep 28, 2024

@HackbrettXXX added some tests and also fixed a bug I found.
Nice to see, that you upgraded all the deps :).

It was a bit of a pain to debug this. Maybe we can move this repo to vite, esm and vitest to improve that situation.
I used soooo much console log :D

Copy link
Member

@HackbrettXXX HackbrettXXX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, thanks for adding the tests, looks good now. I'll merge it. I will publish a release when some of the other PRs are merged, too.

Regarding vite and vitest: I agree, this would be good. However, the vitest browser mode is still experimental and svg2pdf needs a browser context. No idea how good it is already.

@HackbrettXXX HackbrettXXX changed the title fix: marker orientation and context-fill / context-stroke add support for marker "orient" attribute and the "context-fill" and "context-stroke" attributes Oct 16, 2024
@HackbrettXXX HackbrettXXX changed the title add support for marker "orient" attribute and the "context-fill" and "context-stroke" attributes add support for marker "orient" attribute and the "context-fill" and "context-stroke" values Oct 16, 2024
@HackbrettXXX HackbrettXXX merged commit 0891c38 into yWorks:master Oct 16, 2024
1 check passed
@Fuzzyma Fuzzyma deleted the fix-markers branch October 16, 2024 10:00
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.

marker-start not rotating
2 participants