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

This commit is contained in:
Davide Tantillo 2025-08-27 13:34:31 -06:00
parent 8d280e93e2
commit 8106e656e4

View File

@ -663,14 +663,18 @@ export class Spine extends ViewContainer {
const skeletonColor = skeleton.color;
const slotColor = pose.color;
const attachmentColor = attachment.color;
const alpha = skeletonColor.a * slotColor.a * attachmentColor.a;
if (this.alpha === 0 || alpha === 0) {
cacheData.skipRender = true;
} else {
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 (pose.darkColor) {
@ -690,6 +694,7 @@ export class Spine extends ViewContainer {
this.updateClippingData(cacheData);
}
}
}
else if (attachment instanceof ClippingAttachment) {
clipper.clipEnd(slot);
clipper.clipStart(skeleton, slot, attachment);