mirror of https://github.com/axmolengine/axmol.git
Fix ClippingAttachment doesn't work
Refer to: https://github.com/EsotericSoftware/spine-runtimes/pull/2011 Reported by: @kangleblue Signed-off-by: halx99 <halx99@live.com>
This commit is contained in:
parent
2a6e749ad4
commit
aaef0c3048
|
@ -915,14 +915,18 @@ namespace {
|
||||||
Attachment *attachment = slot.getAttachment();
|
Attachment *attachment = slot.getAttachment();
|
||||||
if (!attachment ||
|
if (!attachment ||
|
||||||
slotIsOutRange(slot, startSlotIndex, endSlotIndex) ||
|
slotIsOutRange(slot, startSlotIndex, endSlotIndex) ||
|
||||||
!slot.getBone().isActive() ||
|
!slot.getBone().isActive())
|
||||||
slot.getColor().a == 0)
|
|
||||||
return true;
|
return true;
|
||||||
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
|
const auto& attachmentRTTI = attachment->getRTTI();
|
||||||
|
if (attachmentRTTI.isExactly(ClippingAttachment::rtti))
|
||||||
|
return false;
|
||||||
|
if (slot.getColor().a == 0)
|
||||||
|
return true;
|
||||||
|
if (attachmentRTTI.isExactly(RegionAttachment::rtti)) {
|
||||||
if (static_cast<RegionAttachment*>(attachment)->getColor().a == 0)
|
if (static_cast<RegionAttachment*>(attachment)->getColor().a == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
|
else if (attachmentRTTI.isExactly(MeshAttachment::rtti)) {
|
||||||
if (static_cast<MeshAttachment*>(attachment)->getColor().a == 0)
|
if (static_cast<MeshAttachment*>(attachment)->getColor().a == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue