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

Paint order #4303

Merged
merged 15 commits into from
Sep 17, 2017
Merged

Paint order #4303

merged 15 commits into from
Sep 17, 2017

Conversation

stefanhayden
Copy link
Member

This PR updates Fabric to respect the paint-order attribute in SVG2 as documented here: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/paint-order

This will both read paint-order from an SVG and output it to an svg from fabric.

Internally fabric will call this paintFirst as fabric only has stroke or fill to draw first and does not implement the more complicated markers. Setting paintFirst to fill or stroke will draw that first and will get drawn over by what is painted second.

this did break some tests that were not expecting to see paintFirst come out of toObject and I've add 1 tests for loading in an svg with the value, checking the value is set correctly, then exporting to SVG and then also checking for the correct output.

@stefanhayden
Copy link
Member Author

I see I have some cleanup to still do on this.

@asturur
Copy link
Member

asturur commented Sep 13, 2017

And that requireOwnCache is too strict.
I think you need to force cache if you have inverted stroke + shadow.

@asturur asturur merged commit 0fc7134 into fabricjs:master Sep 17, 2017
@asturur asturur mentioned this pull request Nov 19, 2017
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.

2 participants