Placing content in Figma without overlapping content that is already there

Hello,
I am working on a plugin that places images in Figma and I was wondering if there is a method I missed in the documentation that can help place the images in the Figma canvas without overlapping content that is already there.

thanks :slight_smile:

The only way is to loop through all objects’ coordinates on canvas and find a free space algorithmically.

1 Like

Basically, what you need to do is check the coordinates and the width and height of the children of the PageNode, and then calculate whether your object overlaps other objects on the canvas.

Links to relevant properties:

2 Likes