@esotericsoftware/spine-core 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.
@@ -4072,11 +4072,13 @@ var spine = (() => {
4072
4072
  if (!last) {
4073
4073
  this.setCurrent(trackIndex, entry, true);
4074
4074
  this.queue.drain();
4075
+ if (delay < 0)
4076
+ delay = 0;
4075
4077
  } else {
4076
4078
  last.next = entry;
4077
4079
  entry.previous = last;
4078
4080
  if (delay <= 0)
4079
- delay += last.getTrackComplete() - entry.mixDuration;
4081
+ delay = Math.max(delay + last.getTrackComplete() - entry.mixDuration, 0);
4080
4082
  }
4081
4083
  entry.delay = delay;
4082
4084
  return entry;
@@ -4115,7 +4117,7 @@ var spine = (() => {
4115
4117
  addEmptyAnimation(trackIndex, mixDuration = 0, delay = 0) {
4116
4118
  let entry = this.addAnimationWith(trackIndex, _AnimationState.emptyAnimation(), false, delay);
4117
4119
  if (delay <= 0)
4118
- entry.delay += entry.mixDuration - mixDuration;
4120
+ entry.delay = Math.max(entry.delay + entry.mixDuration - mixDuration, 0);
4119
4121
  entry.mixDuration = mixDuration;
4120
4122
  entry.trackEnd = mixDuration;
4121
4123
  return entry;
@@ -4399,8 +4401,12 @@ var spine = (() => {
4399
4401
  }
4400
4402
  setMixDurationWithDelay(mixDuration, delay) {
4401
4403
  this._mixDuration = mixDuration;
4402
- if (this.previous != null && delay <= 0)
4403
- delay += this.previous.getTrackComplete() - mixDuration;
4404
+ if (delay <= 0) {
4405
+ if (this.previous != null)
4406
+ delay = Math.max(delay + this.previous.getTrackComplete() - mixDuration, 0);
4407
+ else
4408
+ delay = 0;
4409
+ }
4404
4410
  this.delay = delay;
4405
4411
  }
4406
4412
  /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which