Skip to main content
Solved

Strange whitespace around shapes


Edmund_Gauci

I’m having trouble properly sizing shapes because they end up with a lot of whitespace around them.

I create a shape (StarNode, PolygonNode, or EllipseNode, then a TextNode. I resize both to the same dimensions. Then I put them into a GroupNode and finally resize the GroupNode the same.

The ellipse works perfectly, but star and polygon have significant whitespace.

While it looks alright, it makes proper sizing difficult.

Any thoughts on how I can make the size fit snugly around the shape? This is my first Figma plugin project and I’m likely missing something obvious.

I can provide the code if it will help.

Best answer by ntfromchicago

That empty space is built into star and polygon because if you change the number of sides/points, it will still fit fine in the given area.

If you don’t need that empty space any longer (and don’t plan to change the number of sides/points) flatten the node with the plugin API: flatten · Figma Developers

Flattening the node will remove the whitespace.

View original
This topic has been closed for replies.

2 replies

ntfromchicago
  • New Member
  • 287 replies
  • Answer
  • March 15, 2022

That empty space is built into star and polygon because if you change the number of sides/points, it will still fit fine in the given area.

If you don’t need that empty space any longer (and don’t plan to change the number of sides/points) flatten the node with the plugin API: flatten · Figma Developers

Flattening the node will remove the whitespace.


Edmund_Gauci

Thank you. Flatten is exactly what I need.


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