tldraw icon indicating copy to clipboard operation
tldraw copied to clipboard

[Feature]: Customizable export padding

Open dimateos opened this issue 1 year ago • 3 comments

What's the feature?

I feel like the padding should be customizable or maybe a simple toggle. It is added even when the export is set as transparent leading to bigger images than expected.

For reference, here is an issue in excalidraw for more context and rationale https://github.com/excalidraw/excalidraw/issues/6276 image

Best regards!

Contact Details

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

dimateos avatar Jun 07 '24 09:06 dimateos

if you're exporting a single frame shape, there's no padding. try adding your content to a frame shape and setting the padding how you like before export

SomeHats avatar Jun 10 '24 13:06 SomeHats

Thanks for the tip! seems good enough for multi-image compositions.

But I was looking for quick rasterized image copy-pasting between apps, so having to do intermediate steps would defeat the purpose (I could also crop the image within office word etc)

dimateos avatar Jun 11 '24 06:06 dimateos

We have defaultSvgPadding option on the TldrawOptions.

Think that's just what you need (it applies both to svg as well as png exports)?

MitjaBezensek avatar Jul 16 '24 13:07 MitjaBezensek

Yep that looks like it thanks!

Although, I was looking to be able edit it among other preferences in the base web app tldraw.com It could be a simple toggle like the others prefs and set the that value under the hood (0 / default value), or regular input widget.

dimateos avatar Jul 16 '24 13:07 dimateos

We won't be adding this to tldraw.com anytime soon but, as @MitjaBezensek explained, you can tweak it in remixed tldraw instances!

mimecuvalo avatar Jul 24 '24 12:07 mimecuvalo