Skip to main content
Solved

Problem with constraints not properly calculating the left margin on another sized screen


Christina_Helmer
  • After creating a component of my screen, I made a copy and changed the size of the second screen.
  • In the new larger screen the content is not sitting in the correct placement. I would expect that since the constraint is set to left that it should maintain the same left margin space on the second screen like what usually happens.
    image
  • However I notice that every so many pixels the content will just jump and add another 60px or so than the original component when they should be the same.

Best answer by Gleb

Oh, I see! This is happening because of the layout grids. Constraints stick to them instead of the frame borders.

View original

11 replies

Gleb
  • Power Member
  • 4706 replies
  • February 19, 2021

Can you maybe record a video or share a file link? It’s hard to understand the issue. And if you are certain this is a bug, you need to share this with the Figma support team via support@figma.com or the support request form.

P.S. Moving the topic from #plugin-api since it’s not related to the API.


Josh
  • Former Community Manager
  • 1019 replies
  • February 19, 2021

The constraints apply to the children not to the parent. In the screenshot it looks like you have the component selected and that has the top-left constraint but this only applies to whatever is within the component.

Can you share the constraints of the frame it’s nested in?


Christina_Helmer

Sorry I saw the #bug tag and was hoping it was the right one! Here is a copy of the file with just the screens I am having issues with.

design file


Josh
  • Former Community Manager
  • 1019 replies
  • February 19, 2021

I’m looking at the file now. Thanks for sharing the screen recording too!


Gleb
  • Power Member
  • 4706 replies
  • Answer
  • February 19, 2021

Oh, I see! This is happening because of the layout grids. Constraints stick to them instead of the frame borders.


Josh
  • Former Community Manager
  • 1019 replies
  • February 19, 2021

@Gleb you beat me too it!


Christina_Helmer

Thanks guys! I thought it was a bug as I did not place the grids and didnt even realize they were there! I guess its not a bug (thank the lord!)


Mr.Biscuit
  • 109 replies
  • February 25, 2021

I think I just found the correct usage of this


Gleb
  • Power Member
  • 4706 replies
  • February 25, 2021

Omg what! This is fantastic!


Christina_Helmer

@Mr.Biscuit what is this magic? I am a little lost on how you did that and would love to understand!


Mr.Biscuit
  • 109 replies
  • February 25, 2021

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