Jump to content
Search Community

Get end boundingRect for Tween?

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

Yeah, I'm unclear about what exactly you're asking or why. Is it one element and you're trying to figure out the bounding box of the entire animation? For example, if you've got a 10x10 element that starts at coordinates 0,0 and animates 100px to the right, the bounding box would be {top:0, left:0, right:110, bottom:10}? 

 

Like @OSUblake said, a demo would REALLY help. 

Link to comment
Share on other sites

23 minutes ago, GreenSock said:

Yeah, I'm unclear about what exactly you're asking or why. Is it one element and you're trying to figure out the bounding box of the entire animation? For example, if you've got a 10x10 element that starts at coordinates 0,0 and animates 100px to the right, the bounding box would be {top:0, left:0, right:110, bottom:10}? 

 

Like @OSUblake said, a demo would REALLY help. 

 

@OSUblake

Im animating tweens tied to scroll, and when doing an Y transform, the progress reaches 1 before the element of the tween is out of view. I reckon this is because in my this.elems array i'm only storing the start bounds of the elements, when I would need the end bounds. 

Take a look at the first animated element in this demo below, and u can see what I mean. So i was thinking that in my getElems method, maybe I should put the timeline progress to 1, set the bounds, then put it back to progress 0 ?

 

See the Pen PxrZdp by ReGGae (@ReGGae) on CodePen

 . 

Link to comment
Share on other sites

19 hours ago, jesper.landberg said:

So i was thinking that in my getElems method, maybe I should put the timeline progress to 1, set the bounds, then put it back to progress 0 ?

 

Did you try that? Sorry, I just don't have a lot of time at the moment to parse through all the code. So if your idea works, it'd be cool to know ;) If your goal is to figure out the bounds at the start and the end and combine them, that certainly seems like a viable solution. 

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