Jump to content
Search Community

Scaling and border radius

tganyan test
Moderator Tag

Recommended Posts

I'm in the middle of creating an effect that involves scaling down a parent container and adding rounded borders to it in the process. The issue I've come up on is that scaling it down, particularly if I need to reduce the width more than the height, is messing with the border radius and I'm not certain how to address this. I did read elsewhere that animating width and height, instead of scaling, fixes the issue, however when I use width and height it sometimes creates this stutter effect that I can't have and scale tends to eliminate that. I have this issue open on stackoverflow as well, but the GSAP forums are always so great and responsive I thought I'd check over here as well. 

 

Codepen is dumbed down for the sake of offering a simple example of the issue.

 

Thanks in advance for any advice on this!

 

See the Pen qBYqvLX by tganyan (@tganyan) on CodePen

Link to comment
Share on other sites

Appreciate the response, and sadly you're confirming what I suspected might be the case. I do have one solution in place that basically sets the scale back to 1 and then a hard width and height on the element at the exact end of the animation; it's not perfect, and I don't think it scales all that well, but it gets pretty close to the goal for this project. Will have to chat about it with my designers tomorrow morning and see what's preferred. Thanks again!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...