Skip to main content
Solved

How to stretch a frame but not its child objects

  • February 4, 2021
  • 2 replies
  • 2961 views

wgo
  • New Participant
  • 41 replies

Hi Community,

well over the last 6 months I’ve done some projects in Figma and I thought I was quite familiar with the app by now. But this simple problem makes me scratch my head: how can I stretch a frame and keep its child objects in relatively the same positions but not scale them at the same time?

Let’s say you have a graph like shown in the example. Let’s ignore the line for now… The dots are vertically irregularly spaced, so no auto layout can be applied. I can’t find a way to easily stretch the parent frame vertically so that all the dots retain their relative positions and don’t scale at the same time.

I always thought that setting the constraints to “Center” would do this trick, but it only keeps their distance to the center point of the parent. Has this been changed recently?

Hard to believe that this isn’t possible without any manual corrections afterwards. Can you please point me to the right direction?

Thanks for your help.

Best answer by Gleb

The only option I can see here is to wrap these dots into 0x0 pixel frames. You can find the explanation of this in my Auto Layout Tips & Hacks file: https://figma.fun/nlzApu (simply set frame dimensions to 0.0001). And set the constraints of these frames to Scale. Just checked, this works pretty good.

View original

2 replies

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

The only option I can see here is to wrap these dots into 0x0 pixel frames. You can find the explanation of this in my Auto Layout Tips & Hacks file: https://figma.fun/nlzApu (simply set frame dimensions to 0.0001). And set the constraints of these frames to Scale. Just checked, this works pretty good.


wgo
  • Author
  • New Participant
  • 41 replies
  • February 5, 2021

Ah yeah, I can see how this will work – the 0px-frame-trick again…! Somehow stuff like this (and also the things you show in your file) should be easier to achieve.

But thanks for the solution and responding so quickly.


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