@esotericsoftware/spine-pixi-v8 4.2.106 → 4.2.108

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.
@@ -11892,8 +11892,9 @@ var spineTextureAtlasLoader = {
11892
11892
  },
11893
11893
  async load(url) {
11894
11894
  const response = await DOMAdapter.get().fetch(url);
11895
- const txt = await response.text();
11896
- return txt;
11895
+ if (!response.ok)
11896
+ throw new Error(`[${loaderName}] Failed to fetch ${url}: ${response.status} ${response.statusText}`);
11897
+ return await response.text();
11897
11898
  },
11898
11899
  testParse(asset, options) {
11899
11900
  const isExtensionRight = checkExtension(options.src, ".atlas");
@@ -11974,8 +11975,9 @@ var spineLoaderExtension = {
11974
11975
  },
11975
11976
  async load(url) {
11976
11977
  const response = await DOMAdapter2.get().fetch(url);
11977
- const buffer = new Uint8Array(await response.arrayBuffer());
11978
- return buffer;
11978
+ if (!response.ok)
11979
+ throw new Error(`[${loaderName2}] Failed to fetch ${url}: ${response.status} ${response.statusText}`);
11980
+ return new Uint8Array(await response.arrayBuffer());
11979
11981
  },
11980
11982
  testParse(asset, options) {
11981
11983
  const isJsonSpineModel = checkExtension2(options.src, ".json") && isJson(asset);
@@ -12613,6 +12615,7 @@ var SpinePipe = class {
12613
12615
  } else if (spine.spineTexturesDirty) {
12614
12616
  const drawOrder = spine.skeleton.drawOrder;
12615
12617
  const gpuSpine = this.gpuSpineData[spine.uid];
12618
+ if (!gpuSpine) return false;
12616
12619
  for (let i = 0, n = drawOrder.length; i < n; i++) {
12617
12620
  const slot = drawOrder[i];
12618
12621
  const attachment = slot.getAttachment();
@@ -12684,16 +12687,15 @@ var SpinePipe = class {
12684
12687
  const containerAttachment = spine._slotsObject[slot.data.name];
12685
12688
  if (containerAttachment) {
12686
12689
  const container = containerAttachment.container;
12687
- if (!skipRender) {
12688
- container.includeInBuild = true;
12689
- container.collectRenderables(instructionSet, this.renderer, null);
12690
- }
12690
+ container.includeInBuild = true;
12691
+ container.collectRenderables(instructionSet, this.renderer, null);
12691
12692
  container.includeInBuild = false;
12692
12693
  }
12693
12694
  }
12694
12695
  }
12695
12696
  updateRenderable(spine) {
12696
12697
  const gpuSpine = this.gpuSpineData[spine.uid];
12698
+ if (!gpuSpine) return;
12697
12699
  spine._validateAndTransformAttachments();
12698
12700
  spine.spineAttachmentsDirty = false;
12699
12701
  spine.spineTexturesDirty = false;
@@ -13225,7 +13227,8 @@ var Spine = class _Spine extends ViewContainer {
13225
13227
  updateSlotObject(slotAttachment) {
13226
13228
  const { slot, container } = slotAttachment;
13227
13229
  const followAttachmentValue = slotAttachment.followAttachmentTimeline ? Boolean(slot.attachment) : true;
13228
- container.visible = this.skeleton.drawOrder.includes(slot) && followAttachmentValue;
13230
+ const slotAlpha = this.skeleton.color.a * slot.color.a;
13231
+ container.visible = this.skeleton.drawOrder.includes(slot) && followAttachmentValue && this.alpha > 0 && slotAlpha > 0;
13229
13232
  if (container.visible) {
13230
13233
  let bone = slot.bone;
13231
13234
  const matrix = container.localTransform;
@@ -13236,7 +13239,7 @@ var Spine = class _Spine extends ViewContainer {
13236
13239
  matrix.tx = bone.worldX;
13237
13240
  matrix.ty = bone.worldY;
13238
13241
  container.setFromMatrix(matrix);
13239
- container.alpha = this.skeleton.color.a * slot.color.a;
13242
+ container.alpha = slotAlpha;
13240
13243
  }
13241
13244
  }
13242
13245
  /** @internal */