question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVG export has no size

See original GitHub issue

The SVG root element has no width/height, so they end up drawn at unspecified size. This also means that (as far as I can see) 1x/2x/3x export don’t change anything for SVG.

Maybe something like this:

svgRoot.setAttribute("width", `${width}`);
svgRoot.setAttribute("height", `${height}`);

https://github.com/excalidraw/excalidraw/blob/5950fa9a40ea9aa6a78ae9e79c01395ba0647e63/src/scene/export.ts#L106-L108

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
geraintluffcommented, Oct 28, 2020

I just want to say: this was my first return to open-source collaboration after a long period of burnout. Thank you for making it a pleasant one!

0reactions
dwellecommented, Oct 28, 2020

Thank you as well — and we nearly blew you off 😃. @lipis, maybe this would also fix the enormous logos in readme of this repo: https://github.com/pclainchard/excalidrawLib (scroll down).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make your SVG's have height and width attributes
SVG's exported from Illustrator CC are 'responsive' by default, in other words there is no height or width attributes, no dimensions. This can...
Read more >
SVG exports at a different size to W & H values in editor
When I export the SVG it has a size of 60x61. This is causing crunchy scaling ... The coordinates should be integers, with...
Read more >
Export SVG without artboard size - Adobe Support Community
Use Artboards it's command to use any artboard as independent artwork. You can't use it for add or remove artboard size information. pawel....
Read more >
Ensure the SVG stays the same size after saving or exporting ...
A demo showing how to ensure your SVG file stays the same size after saving or exporting it from Illustrator into Design Space....
Read more >
Exporting as an SVG in Adobe Illustrator canvas size issues
Your problem is that your SVG is being saved with the Artboard, which is set to the default document size. Try using "Object...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found