Figma Support Forum

Get coordinates of Original Shape in Exported Asset

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 :

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?

:pray:

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.