Skip to content

Commit

Permalink
Added reset of delayFor variable to original delay when new loop star…
Browse files Browse the repository at this point in the history
…ts. (#414)
  • Loading branch information
wouterlucas authored Oct 15, 2024
2 parents f4e4619 + e491d9a commit 4afb535
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/animations/CoreAnimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class CoreAnimation extends EventEmitter {
public settings: AnimationSettings;
private progress = 0;
private delayFor = 0;
private delay = 0;
private timingFunction: (t: number) => number | undefined;

propValuesMap: PropValuesMap = {};
Expand Down Expand Up @@ -109,6 +110,7 @@ export class CoreAnimation extends EventEmitter {
};
this.timingFunction = getTimingFunction(easing);
this.delayFor = delay;
this.delay = delay;
}

reset() {
Expand Down Expand Up @@ -287,6 +289,7 @@ export class CoreAnimation extends EventEmitter {

if (this.progress > 1) {
this.progress = loop ? 0 : 1;
this.delayFor = this.delay;
if (stopMethod) {
// If there's a stop method emit finished so the stop method can be applied.
// TODO: We should probably reevaluate how stopMethod is implemented as currently
Expand Down

0 comments on commit 4afb535

Please sign in to comment.