Skip to content

Commit

Permalink
Merge pull request #373 from fantasycalendar/Fix_PlaybackRate
Browse files Browse the repository at this point in the history
Fix Playback Rate + Out Animations
  • Loading branch information
Haxxer authored Dec 2, 2024
2 parents 77902c8 + 9701bab commit 7f64b3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Version 3.4.7
- *Effects* - Fixed `.stretchTo(target, { attachTo: true })` with range-finding effects not properly preloading its different files
- *Effects* - Fixed `.playbackRate()` not working well with `.fadeOut()` and similar `out` animations

# Version 3.4.6
- *Effects* - Added `effect` as a valid `.animateProperty()` and `.loopProperty()` target
Expand Down
4 changes: 3 additions & 1 deletion src/canvas-effects/canvas-effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,8 @@ export default class CanvasEffect extends PIXI.Container {
? (this._animationDuration * this.loops) + (this.loopDelay * (this.loops - 1))
: this._animationDuration;

this._totalDuration /= playbackRate;

if(this.data.persist){
this.mediaLooping = (
(!this.data.time || (this._startTime === 0 && this._endTime === this.mediaDuration)) &&
Expand Down Expand Up @@ -3151,7 +3153,7 @@ export default class CanvasEffect extends PIXI.Container {
setTimeout(() => {
this._resolve(this.data);
this.endEffect();
}, this._totalDuration / this.mediaPlaybackRate);
}, this._totalDuration);
}

_setupTimestampHook(offset) {
Expand Down

0 comments on commit 7f64b3e

Please sign in to comment.