Jump to content
Search Community

isActive() issue with repeat:-1

trsh 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

You're absolutely right. Sorry about that. It should be fixed in the next release which you can preview (uncompressed) at: https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/TweenMax-latest-beta.js

 

If you want to patch the current version, you could add this code to your project (after GSAP loads of course) which alters the prototype:

TweenLite.prototype.isActive = function() {
var tl = this._timeline, 
          startTime = this._startTime,
          rawTime;
  return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale));
};
TimelineLite.prototype.rawTime = function(wrapRepeats) {
  return (wrapRepeats && (this._paused || (this._repeat && this.time() > 0 && this.totalProgress() < 1))) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(wrapRepeats) - this._startTime) * this._timeScale;
};

Thanks for reporting this. 

  • Like 4
Link to comment
Share on other sites

 

You're absolutely right. Sorry about that. It should be fixed in the next release which you can preview (uncompressed) at: https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/TweenMax-latest-beta.js

 

If you want to patch the current version, you could add this code to your project (after GSAP loads of course) which alters the prototype:

TweenLite.prototype.isActive = function() {
var tl = this._timeline, 
          startTime = this._startTime,
          rawTime;
  return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale));
};
TimelineLite.prototype.rawTime = function(wrapRepeats) {
  return (wrapRepeats && (this._paused || (this._repeat && this.time() > 0 && this.totalProgress() < 1))) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(wrapRepeats) - this._startTime) * this._timeScale;
};

Thanks for reporting this. 

 

 

Great! Tnx :)

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