Nested image components lose scaling after instance swap
- 0 replies
- 6 views
Hi everyone!
I've been struggling with a scaling issue involving nested component instances in Figma and was wondering if anyone else has experienced this or knows a possible solution.
I'm working with a fairly complex component library that uses multiple levels of nested components, variants, and exposed instance swap properties.
The problem
When I scale a component using Figma's Scale Tool (K), everything initially looks correct. However, when I use that component as an instance outside its main component and change one of its nested states through the properties panel, some image layers suddenly jump back to their original size.
Interestingly, the surrounding components remain correctly scaled. Only the image layers inside certain nested instances seem to lose their scaling.
I've managed to reproduce this with a much simpler setup using colored image-filled rectangles, so it doesn't appear to be related to the complexity of my original components.
How to reproduce
-
Create a component containing a 50 × 50 px rectangle with an image fill.
-
Create different states or interchangeable components with different images.
-
Nest these components inside other components and expose their properties.
-
Create an instance of the parent component outside the main component.
-
Scale a nested component using the Scale Tool (K), for example to 69.1%.
-
Switch the nested component to another state using the properties panel.
Expected behavior:
The image should remain at its scaled size of approximately 34.55 × 34.55 px.
Actual behavior:
The nested instance still has the correct scale factor of 0.691, but the image layer inside it jumps back to 50 × 50 px.
This causes the image to appear much larger than the surrounding elements.
What I've tried
I've experimented with different component structures and Auto Layout, but unfortunately couldn't resolve the issue.
I even created a small Figma plugin to investigate the behavior. It confirmed that the scaling factor of the nested instance remains correct, while the image layer itself resets to its original dimensions.
Unfortunately, attempts to correct the scaling through the Plugin API were blocked by Figma's instance override restrictions.
Why this is particularly frustrating
We rely on shared component libraries and use Figma Dev Mode to provide developers with accurate dimensions and positions.
Because of this, simply masking the oversized images or detaching instances isn't really an option. The actual geometry needs to remain correct, and all components need to stay connected to their libraries.
I've attached a screen recording showing the component structure and exactly when the issue occurs.
Has anyone encountered something similar?
Is this a known limitation or possibly a bug in how Figma handles scaling within nested instances?
I'd really appreciate any suggestions or workarounds that preserve the original component connections and correct dimensions.
Thanks in advance!
