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

Svg viewport transform fixes #2642

Merged
merged 4 commits into from
Dec 2, 2015
Merged

Svg viewport transform fixes #2642

merged 4 commits into from
Dec 2, 2015

Conversation

asturur
Copy link
Member

@asturur asturur commented Nov 22, 2015

Currently the property svgViewportTransformation does not produce correct output if set to false.
The option should ignore viewportTransform but it produce also a smaller svg.

This PR also separate the width and heigth from the viewbox and centralize the viewport handling in the svgHeader where the viewbox parameter is.

current BUG on fabricjs.com kitchensink viewport set to [1.5, 0, 0, 2, -100, 100]
image

svg output is correct.

Now we set canvas.svgViewportTransformation = false;
and svg output is:
image

instead of correct output that should be this:
image

This because the function is dividing width and heigth of the svg to zoom back to 1.

Now also is possible to export svg desired size:
canvas.toSVG({width: '500mm', height: '500mm'});
canvas.toSVG({width: 300, height: 1500});

this will produce svg of desired dimension without changing aspect ratio.

@asturur
Copy link
Member Author

asturur commented Nov 22, 2015

fixed also shadow tests.

@asturur
Copy link
Member Author

asturur commented Nov 22, 2015

@kangax ready to merge

kangax added a commit that referenced this pull request Dec 2, 2015
@kangax kangax merged commit c415792 into fabricjs:master Dec 2, 2015
@asturur asturur deleted the svg-viewport branch December 6, 2015 18:32
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