Skip to main content
Question

Get coordinates of Original Shape in Exported Asset

  • March 11, 2021
  • 1 reply
  • 1285 views

cochet

Hello !

Do you have a special strategy to get the coordinates of a rectangle with shadow when it gets exported in SVG, PNG, …?

This Figma file is simple to understand the problem :

Figma – 11 Mar 21

Currently I am working on a function to get the bounding box of a Figma Node and looking at the shadow + border + angle. But if you export a Node with a lot of children pushing the bounding box, then you have to traverse the entire tree to get the actual bounding box that will be exported.

Do you think of a better strategy?

πŸ™

1 reply

Gleb
  • Power Member
  • 4706 replies
  • March 12, 2021

Unfortunately, you will need to traverse all children, there is no workaround as far as I know. And you also need to handle their rotations and other transformations in order to get the correct bounding box.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings