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

canvas.clipPath creates invalid SVG file #5414

Closed
jessemtcarlton opened this issue Nov 29, 2018 · 2 comments · Fixed by #5424
Closed

canvas.clipPath creates invalid SVG file #5414

jessemtcarlton opened this issue Nov 29, 2018 · 2 comments · Fixed by #5424

Comments

@jessemtcarlton
Copy link

jessemtcarlton commented Nov 29, 2018

Version

2.4.4

Test Case

https://jsfiddle.net/jester1983/Da7SP/3171/

Information about environment

chrome

Steps to reproduce

create canvas, apply clipPath to canvas, toSVG the canvas

Expected Behavior

clipPath path element has one transform attribute

Actual Behavior

2 transform attributes, strict svg parsers fail

<clipPath id="CLIPPATH_1" >
	<path transform="matrix(2 0 0 1 201 150.5) translate(-150, -150)" d="M 100 100 v 100 h 100 V 100 H 100 z" stroke-linecap="round" transform=" translate(-150, -150)" />
</clipPath>

circle (and presumably other objects) are correct:

<clipPath id="CLIPPATH_3" >
	<circle transform="matrix(1 0 0 1 150.5 100.5)" cx="0" cy="0" r="100" />
</clipPath>
@asturur
Copy link
Member

asturur commented Dec 8, 2018

thanks for the report, i ll fix this.

@asturur
Copy link
Member

asturur commented Dec 9, 2018

luckily enough that extra transform was a left over from a rewrite to enable clipPath in svg. easy fix with a deletion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants