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

DRAFT: SVG export and isPath removal #9488

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

asturur
Copy link
Member

@asturur asturur commented Nov 8, 2023

Motivation

We discussed the type assertion and the removal of isPath, and its usage that excluded polygon and polyline in svg gradient export.
The test added reveals that indeed path export for gradient is slightly different, and so this PR would break it.
Better investigation is needed.

Changes

remove internal utility isPath

@asturur asturur marked this pull request as draft November 8, 2023 01:19
@asturur
Copy link
Member Author

asturur commented Nov 8, 2023

Ok the difference is that at time of svg export:

  • path represent the pathOffset with a translation
  • polygon absorbs the translation by subtracting it to each point value

so it make sense that the gradients with userSpaceOnUse behave differently.

Not sure is worth touching, probably it is, with the right priority.

An idea would be that the function:
_getOffsetTransform from Path gets duplicate to Polyline together with the toSVG one that adds the extra transform.

it would be made only to unify all the handling of objects that use a pathOffset object, that is not bad, but then we have to test for SVG exports regressions

The other possible solution is to have path absorb the offset like the polygon

The last one is to not touch nothin and leave a fabric.Path detection code.

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