@esotericsoftware/spine-canvas 4.2.3 → 4.2.6

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.
@@ -514,7 +514,7 @@ var spine = (() => {
514
514
  this.bones = null;
515
515
  this.vertices = [];
516
516
  this.worldVerticesLength = 0;
517
- this.timelineAttahment = this;
517
+ this.timelineAttachment = this;
518
518
  }
519
519
  computeWorldVertices(slot, start, count, worldVertices, offset, stride) {
520
520
  count = offset + (count >> 1) * stride;
@@ -585,7 +585,7 @@ var spine = (() => {
585
585
  Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);
586
586
  }
587
587
  attachment.worldVerticesLength = this.worldVerticesLength;
588
- attachment.timelineAttahment = this.timelineAttahment;
588
+ attachment.timelineAttachment = this.timelineAttachment;
589
589
  }
590
590
  };
591
591
  var VertexAttachment = _VertexAttachment;
@@ -1884,7 +1884,7 @@ var spine = (() => {
1884
1884
  let slotAttachment = slot.getAttachment();
1885
1885
  if (!slotAttachment)
1886
1886
  return;
1887
- if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttahment != this.attachment)
1887
+ if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != this.attachment)
1888
1888
  return;
1889
1889
  let deform = slot.deform;
1890
1890
  if (deform.length == 0)
@@ -2463,7 +2463,7 @@ var spine = (() => {
2463
2463
  let slotAttachment = slot.attachment;
2464
2464
  let attachment = this.attachment;
2465
2465
  if (slotAttachment != attachment) {
2466
- if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttahment != attachment)
2466
+ if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != attachment)
2467
2467
  return;
2468
2468
  }
2469
2469
  let frames = this.frames;
@@ -2476,6 +2476,8 @@ var spine = (() => {
2476
2476
  let before = frames[i];
2477
2477
  let modeAndIndex = frames[i + _SequenceTimeline.MODE];
2478
2478
  let delay = frames[i + _SequenceTimeline.DELAY];
2479
+ if (!this.attachment.sequence)
2480
+ return;
2479
2481
  let index = modeAndIndex >> 4, count = this.attachment.sequence.regions.length;
2480
2482
  let mode = SequenceModeValues[modeAndIndex & 15];
2481
2483
  if (mode != SequenceMode.hold) {
@@ -2489,7 +2491,7 @@ var spine = (() => {
2489
2491
  break;
2490
2492
  case SequenceMode.pingpong: {
2491
2493
  let n = (count << 1) - 2;
2492
- index %= n;
2494
+ index = n == 0 ? 0 : index % n;
2493
2495
  if (index >= count)
2494
2496
  index = n - index;
2495
2497
  break;
@@ -2502,7 +2504,7 @@ var spine = (() => {
2502
2504
  break;
2503
2505
  case SequenceMode.pingpongReverse: {
2504
2506
  let n = (count << 1) - 2;
2505
- index = (index + count - 1) % n;
2507
+ index = n == 0 ? 0 : (index + count - 1) % n;
2506
2508
  if (index >= count)
2507
2509
  index = n - index;
2508
2510
  }
@@ -3790,7 +3792,7 @@ var spine = (() => {
3790
3792
  let copy = new MeshAttachment(this.name, this.path);
3791
3793
  copy.region = this.region;
3792
3794
  copy.color.setFromColor(this.color);
3793
- copy.timelineAttahment = this.timelineAttahment;
3795
+ copy.timelineAttachment = this.timelineAttachment;
3794
3796
  copy.setParentMesh(this.parentMesh ? this.parentMesh : this);
3795
3797
  if (copy.region != null)
3796
3798
  copy.updateRegion();
@@ -5438,7 +5440,7 @@ var spine = (() => {
5438
5440
  setAttachment(attachment) {
5439
5441
  if (this.attachment == attachment)
5440
5442
  return;
5441
- if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.timelineAttahment != this.attachment.timelineAttahment) {
5443
+ if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.timelineAttachment != this.attachment.timelineAttachment) {
5442
5444
  this.deform.length = 0;
5443
5445
  }
5444
5446
  this.attachment = attachment;
@@ -6644,7 +6646,7 @@ var spine = (() => {
6644
6646
  let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
6645
6647
  if (!parent)
6646
6648
  throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
6647
- linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
6649
+ linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
6648
6650
  linkedMesh.mesh.setParentMesh(parent);
6649
6651
  if (linkedMesh.mesh.region != null)
6650
6652
  linkedMesh.mesh.updateRegion();
@@ -8451,7 +8453,7 @@ var spine = (() => {
8451
8453
  let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
8452
8454
  if (!parent)
8453
8455
  throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
8454
- linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
8456
+ linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;
8455
8457
  linkedMesh.mesh.setParentMesh(parent);
8456
8458
  if (linkedMesh.mesh.region != null)
8457
8459
  linkedMesh.mesh.updateRegion();