Jump to content
Search Community

SVG Rotation - svgOrigin inconsistent across browsers

Loveurope Group LTD test
Moderator Tag

Recommended Posts

  • Loveurope Group LTD changed the title to SVG Rotation - svgOrigin inconsistent across browsers

Thanks for the clear demo.

 

It appears that using transformOrigin:"50% 50%" works fine in FireFox

 

See the Pen oNJjXKg by snorkltv (@snorkltv) on CodePen

 

Being that things in the defs aren't actually rendered in the SVG I'm not so sure it's appropriate to apply svgOrigin to them.

 

I suspect someone from team @GreenSock will be able to provide a more thorough investigation and answer when time allows.

 

  • Like 1
Link to comment
Share on other sites

Yep, a <clipPath> isn't a very browser-safe thing to animate, at least with certain properties like transformOrigin or svgOrigin because it's not a rendered thing and thus some browsers refuse to report width/height. Firefox literally gives you no way to determine the bounding box size - it doesn't even have getBBox() or getCTM() methods like all other SVG elements. Even the getBoundingClientRect() method returns 0 for width/height. 

 

A strong case could be made for Firefox and Safari's implementation having bugs. 

 

I've been looking for a few hours, trying to find some way to work around that but I haven't come up with anything yet. I'll keep looking.  

  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...

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