Skip to main content
Solved

How to scale an instance nested in another component?


Simone

I have 2 components called ‘card red’ and ‘card blue’, exactly the same size 300x200, only difference is the colour.

I have to use the card inside another component called ‘card+badge’, made of the card itself and a small badge (together in an autolayout); in this component my card is scaled to 240x160.

Now my problems is:
if I change the card from red to blue (component 1 to 2) inside the ‘card+badge’ original component, it’s al fine; if I change them inside and instance of ‘card+badge’, the card size comes back to its originale 300x200, basically breaking my design!

Is there a solution to keep the size of the card 240x160 that I fixed in my ‘card+badge’ component?

Best answer by Gleb

Depending on your needs, you need to either enable or disable Hug Contents for nested instances:

View original
This topic has been closed for comments

Gleb
  • Power Member
  • March 14, 2021

Depending on your needs, you need to either enable or disable Hug Contents for nested instances:


Mike_Escoffery

I don’t actually consider this a solve. This relates to needing SCALE as a property, so that when we scale a nested component instance, it also applies that Scale Property when swapping to a new instance. Please vote here: Scale as a property


Sean_Sands

As @Mike_Escoffery has stated, this is not a solution. This allows you to resize the dimensions of the object…NOT scale. If it WAS scaling, it would do so proportionally.


Gleb
  • Power Member
  • August 19, 2022

Good point. In this case vote for the topic linked above and add your own ideas to it. Scale as a property This one can be merged or closed. @Josh


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