[ts][pixi-v8] Prevent rendering of attachments with alpha 0. See #2912.

This commit is contained in:
Davide Tantillo 2025-08-27 16:59:56 -06:00
parent 5d5473ee9f
commit c3ea9fd931

View File

@ -658,16 +658,19 @@ export class Spine extends ViewContainer {
const skeleton = slot.bone.skeleton;
const skeletonColor = skeleton.color;
const slotColor = slot.color;
const attachmentColor = attachment.color;
const alpha = skeletonColor.a * slotColor.a * attachmentColor.a;
cacheData.color.set(
skeletonColor.r * slotColor.r * attachmentColor.r,
skeletonColor.g * slotColor.g * attachmentColor.g,
skeletonColor.b * slotColor.b * attachmentColor.b,
skeletonColor.a * slotColor.a * attachmentColor.a,
alpha,
);
if (this.alpha === 0 || alpha === 0) {
cacheData.skipRender = true;
} else {
if (slot.darkColor) {
cacheData.darkColor.setFromColor(slot.darkColor);
}
@ -685,6 +688,8 @@ export class Spine extends ViewContainer {
this.updateClippingData(cacheData);
}
}
}
else if (attachment instanceof ClippingAttachment) {
clipper.clipStart(slot, attachment);
continue;