True Aspect Ratio Lock

Also adding a big +1 to this.

I’ve been using various workarounds for years now, like many others I’m still super surprised this doesn’t exist yet — I swear I google “Figma aspect ratio” once a month just to make sure it hasn’t stealth launched without me noticing!

I did a bit of a deep-dive on the workaround techniques recently and came up with some improvements to the ‘angled line’ one some folks might be interested in (mostly making it much easier to calculate exactly the combination angles needed and removing the need to infinitely nest more spacers inside each other). Also just discovered some kinda weird interesting stuff about auto layout and rotation at the same time.

Made a write up about it here for anyone interested in a distraction while we wait for it! :crossed_fingers:

4 Likes

Hi Matt, your article is brilliant. And is a pitty you consumed so much time researching and writing it since we are talking about such an easy and simple feature to implement for Figma’s team. :exploding_head:

2 Likes

Thanks! Haha — I was aware of that before I did it, but tbh it seemed like a waste to have made this library, figured out all the things and then not share it somewhere.

2 Likes

Still sad though that the situation requires people like you to figure out such fiddly workarounds just because Figma is too lazy to focus on implementation of such basic features.

2 Likes

+1 Still need this 2 years later

6 Likes

What is so difficult about implementing aspect ratio lock? Auto layout already works with vertical resizing… here is a javascript function that returns the sizes needed to keep an objects aspect ratio. Now just call this function when when the constrain proportions button is toggled on. What is the big deal?

<script>
    function maintainAspectRatio(element) {
        // Calculate the initial aspect ratio
        const initialWidth = element.offsetWidth;
        const initialHeight = element.offsetHeight;
        const aspectRatio = initialWidth / initialHeight;

        // Function to resize the element maintaining the aspect ratio
        function resizeElement() {
            const newWidth = element.offsetWidth;
            const newHeight = newWidth / aspectRatio;
            element.style.height = `${newHeight}px`;
        }

        // Attach the resize event listener
        element.addEventListener('resize', resizeElement);
        
        // Initialize the resizing to maintain the initial aspect ratio
        resizeElement();
    }

    // Get the element and apply the aspect ratio maintenance
    const resizableElement = document.getElementById('resizeable');
    maintainAspectRatio(resizableElement);
</script>
4 Likes

Taking bets on this not being part of any config announcements. How this wasn’t in scope as part of Auto Layout 1.0 is crazy

Hey y’all, this plugin has successfully solved this problem for me: https://www.figma.com/community/plugin/1345084434204288101/fixed-aspect-ratio-frame

1 Like

Let’s hope Figma can cross this basic feature off in 2024.

2 Likes

+1, aspect ratio is already a widely supported CSS property.

2 Likes

Ran into this issue today and I was surprised that elements don’t keep their relative size even when “Constrain proportions” is turned on. Please implement this feature!

2 Likes

This is a fundamental need in Figma. I have to break components and design systems to resize images consistently. I really hope this can be addressed.

1 Like

Don’t worry everyone! There’s a bunch of AI garbage that no one asked for! Who cares about basic features that we’ve been asking for for years!

6 Likes

You don’t have to detach the component as there are workarounds like plugins. Probably one reason why Figma don’t see any urgency implementing this feature natively.

Now with AI out of the way at Figma Config 2024, let’s hope they can focus back on what the users want vs their shareholders.

4 Likes

I want this so bad. Auto Layout would benefit so much from this.

2 Likes

I dunno - “Keep the proportions locked on a thing that has specific proportions” just feels fundamental to me. I’m not making the leap to this being a feature that should be in plugin or component territory.

8 Likes

Is there any way that Figma will ever respond to this or a way to get them to respond? Even a, “No.” or anything? Seeing all these features shown off at Config and so little features getting crossed off these forum posts is very discouraging. Just feels like we’re yelling into the void

7 Likes

There is no way to lock the responsive aspect ratio of a shape or image. This is a really common requirement but really limits the effectiveness of responsive designs.

E.g. I have a 1:1 aspect ratio image on mobile, I want that image to be 1:1 on tablet. Right now this is not supported responsive behavior. Design file example / explanation here: https://www.figma.com/design/qW44TD0IYhiXzaaioioSe3/Repsonsive-image?node-id=0-1&t=zYHwDKI9qSR3KVpY-1

1 Like

I’ve asked for this 3 times, it’s one of the top voted feature on this forum. Please do this soon, it’s such a common requirement when designing

5 Likes