Component contents resets size when I change variant

I’ve created a component that contains a set of icons, where each icon is a variant.

I can create instances and resize the instances and that works well. But if I change the size of the instance and then change the variant, the icon itself reverts to it’s original size.

  1. Create an instance

    image

  2. Resize the instance

  3. Change to a different variant

Is there anything I can do to have the icon stay the same size even after I change variants?

Component scaling problem.penpot (541.6 KB)

For context, each variant consists of a board, which contains a group, which in turn contains an svg-path and a hidden background.

When changing variant, the board keeps it size while the svg-path and the background revert to their default sizes.

Hi,
If you place the icon in an autolayout container and set the icon to fill the container, you should be able to resize the container (and consequently resize the icon inside it) without any resets after switching between icon variations.
Component scaling problem_containerSolution.penpot (525.0 KB)

4 Likes

Thank you! That worked :grinning_face:

This also seems to be related to bug #12172, which was fixed in 2.11 :+1:

1 Like