@esotericsoftware/spine-canvaskit 4.2.80 → 4.2.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4076,11 +4076,13 @@ var spine = (() => {
4076
4076
  if (!last) {
4077
4077
  this.setCurrent(trackIndex, entry, true);
4078
4078
  this.queue.drain();
4079
+ if (delay < 0)
4080
+ delay = 0;
4079
4081
  } else {
4080
4082
  last.next = entry;
4081
4083
  entry.previous = last;
4082
4084
  if (delay <= 0)
4083
- delay += last.getTrackComplete() - entry.mixDuration;
4085
+ delay = Math.max(delay + last.getTrackComplete() - entry.mixDuration, 0);
4084
4086
  }
4085
4087
  entry.delay = delay;
4086
4088
  return entry;
@@ -4119,7 +4121,7 @@ var spine = (() => {
4119
4121
  addEmptyAnimation(trackIndex, mixDuration = 0, delay = 0) {
4120
4122
  let entry = this.addAnimationWith(trackIndex, _AnimationState.emptyAnimation(), false, delay);
4121
4123
  if (delay <= 0)
4122
- entry.delay += entry.mixDuration - mixDuration;
4124
+ entry.delay = Math.max(entry.delay + entry.mixDuration - mixDuration, 0);
4123
4125
  entry.mixDuration = mixDuration;
4124
4126
  entry.trackEnd = mixDuration;
4125
4127
  return entry;
@@ -4403,8 +4405,12 @@ var spine = (() => {
4403
4405
  }
4404
4406
  setMixDurationWithDelay(mixDuration, delay) {
4405
4407
  this._mixDuration = mixDuration;
4406
- if (this.previous != null && delay <= 0)
4407
- delay += this.previous.getTrackComplete() - mixDuration;
4408
+ if (delay <= 0) {
4409
+ if (this.previous != null)
4410
+ delay = Math.max(delay + this.previous.getTrackComplete() - mixDuration, 0);
4411
+ else
4412
+ delay = 0;
4413
+ }
4408
4414
  this.delay = delay;
4409
4415
  }
4410
4416
  /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which