Jump to content
Sign in to follow this  
Kochab

[By Design] Firefox does not display SVGs exported by AD in a canvas

Recommended Posts

The reason is because AD assigns a width and a height to the SVG of "100%". Firefox does not allow % for width and height in a canvas. I found this info on a stackoverflow question:

https://stackoverflow.com/questions/38106906/canvas-drawimage-inline-svg-doesnt-work-on-firefox

 

After removing the %, it worked.

 

And even the w3schools's article on SVGs does not include a % or any other unit:

https://www.w3schools.com/html/html5_svg.asp

 

Chrome renders it just fine. Again, this is for canvas only. Firefox will render the SVG as is just fine when it's simply pasted into some HTML. But if you try to render it in Firefox inside a canvas, it does not render the SVG.

Share this post


Link to post
Share on other sites
9 hours ago, Kochab said:

Firefox does not allow % for width and height in a canvas.

 

So maybe, as you said, it's a problem in Firefox and not Affinity. Read the SVG specification, the percentage is a valid unit.

 

9 hours ago, Kochab said:

And even the w3schools's article on SVGs does not include a % or any other unit.

 

If only a number is specified without any unit, the number is interpreted as the number of pixels.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.