@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.
@@ -3933,11 +3933,13 @@ var _AnimationState = class {
3933
3933
  if (!last) {
3934
3934
  this.setCurrent(trackIndex, entry, true);
3935
3935
  this.queue.drain();
3936
+ if (delay < 0)
3937
+ delay = 0;
3936
3938
  } else {
3937
3939
  last.next = entry;
3938
3940
  entry.previous = last;
3939
3941
  if (delay <= 0)
3940
- delay += last.getTrackComplete() - entry.mixDuration;
3942
+ delay = Math.max(delay + last.getTrackComplete() - entry.mixDuration, 0);
3941
3943
  }
3942
3944
  entry.delay = delay;
3943
3945
  return entry;
@@ -3976,7 +3978,7 @@ var _AnimationState = class {
3976
3978
  addEmptyAnimation(trackIndex, mixDuration = 0, delay = 0) {
3977
3979
  let entry = this.addAnimationWith(trackIndex, _AnimationState.emptyAnimation(), false, delay);
3978
3980
  if (delay <= 0)
3979
- entry.delay += entry.mixDuration - mixDuration;
3981
+ entry.delay = Math.max(entry.delay + entry.mixDuration - mixDuration, 0);
3980
3982
  entry.mixDuration = mixDuration;
3981
3983
  entry.trackEnd = mixDuration;
3982
3984
  return entry;
@@ -4260,8 +4262,12 @@ var TrackEntry = class {
4260
4262
  }
4261
4263
  setMixDurationWithDelay(mixDuration, delay) {
4262
4264
  this._mixDuration = mixDuration;
4263
- if (this.previous != null && delay <= 0)
4264
- delay += this.previous.getTrackComplete() - mixDuration;
4265
+ if (delay <= 0) {
4266
+ if (this.previous != null)
4267
+ delay = Math.max(delay + this.previous.getTrackComplete() - mixDuration, 0);
4268
+ else
4269
+ delay = 0;
4270
+ }
4265
4271
  this.delay = delay;
4266
4272
  }
4267
4273
  /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which