Skip to main content
Question

Placing content in Figma without overlapping content that is already there

  • January 21, 2023
  • 2 replies
  • 520 views

neicore

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 🙂

This topic has been closed for replies.

2 replies

Gleb
  • Power Member
  • 4710 replies
  • January 21, 2023

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


tank666
  • 4873 replies
  • January 21, 2023

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:


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