mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts][pixi-v8] Prevent rendering of attachments with alpha 0. See #2912.
This commit is contained in:
parent
8d280e93e2
commit
8106e656e4
@ -663,14 +663,18 @@ export class Spine extends ViewContainer {
|
|||||||
|
|
||||||
const skeletonColor = skeleton.color;
|
const skeletonColor = skeleton.color;
|
||||||
const slotColor = pose.color;
|
const slotColor = pose.color;
|
||||||
|
|
||||||
const attachmentColor = attachment.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(
|
cacheData.color.set(
|
||||||
skeletonColor.r * slotColor.r * attachmentColor.r,
|
skeletonColor.r * slotColor.r * attachmentColor.r,
|
||||||
skeletonColor.g * slotColor.g * attachmentColor.g,
|
skeletonColor.g * slotColor.g * attachmentColor.g,
|
||||||
skeletonColor.b * slotColor.b * attachmentColor.b,
|
skeletonColor.b * slotColor.b * attachmentColor.b,
|
||||||
skeletonColor.a * slotColor.a * attachmentColor.a,
|
alpha,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pose.darkColor) {
|
if (pose.darkColor) {
|
||||||
@ -690,6 +694,7 @@ export class Spine extends ViewContainer {
|
|||||||
this.updateClippingData(cacheData);
|
this.updateClippingData(cacheData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (attachment instanceof ClippingAttachment) {
|
else if (attachment instanceof ClippingAttachment) {
|
||||||
clipper.clipEnd(slot);
|
clipper.clipEnd(slot);
|
||||||
clipper.clipStart(skeleton, slot, attachment);
|
clipper.clipStart(skeleton, slot, attachment);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user