Skip to main content
S
28d ago

Scaling image layout, while keeping image proportions

Hi there.
I'm struggling to make a responsive layout that uses images.

In this situation here: https://imgur.com/a/W9VTS8F
It's easy to keep the image centred in the layout. However once the artboard shrinks beyond the size of the image (as in Artboard 3) I want the image to scale, keeping it within its artboard - while keeping it's proportion.

How do I achieve this effect?
Thank you!

2 replies
S
27d ago

The easiest way to do this is with constraints and a nested artboard.

In this example, I have a row that fills the height and width of the artboard and centers its content:

Inside the row I have a layout with a fixed height and width and a max width/height and constraint of 100%.

Inside that I have a nested artboard with the Mode set to Leaf:

S
25d ago

Thank you!
Those layout options within nested artboards are quite a hidden feature :D but thank you! You helped me out a lot!