Jump to content
Search Community

Scaling SVG clip-path from the center?

cartercarter test
Moderator Tag

Recommended Posts

Hey all, I'm having an issue using GSAP to scale an SVG path and clip-path element.

 

The path is scaling relative to the center (which is what I'm looking for) but the clip-path is scaling relative to the top left of the the element. At first I thought it might have been an issue with "normalizing" the SVG path to fit into a viewbox with value "0 0 1 1" but that doesn't seem to be the case. (I've commented out the normalized path at the top of the file, which gives the same result).

 

I've tried a few values for transformOrigin, including "50% 50%" and "center" and "center center" lol

 

Is scaling relative to the center for clip-paths possible?


Thanks!

 

See the Pen PoKgEGE by carterduong (@carterduong) on CodePen

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...