Jump to content
Search Community

center groups

swampthang test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

SVG groups are funny little things that don't always behave the way you'd think and some of the browsers get a bit fussy when you try to position them. getBBox() works well for initial positioning, but is not without its own caveats. If you don't have any transforms applied, you'll be good to go. If you have applied transforms, the data will be incorrect. Blake did a really nice write-up here:

Depending on what you're doing, another option is to create all of your elements at (0,0). It's not always practical, but it makes positioning fairly simple.

 

Happy tweening.

  • Like 3
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...