From 23b51853cec6cc2fa30dc741fd64be6c452c7c26 Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 15 Oct 2019 16:26:49 +0200 Subject: [PATCH] [corona] Fixed clipping, closes #1522. --- spine-corona/spine-corona/spine.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spine-corona/spine-corona/spine.lua b/spine-corona/spine-corona/spine.lua index 7f0941004..98519b1dd 100644 --- a/spine-corona/spine-corona/spine.lua +++ b/spine-corona/spine-corona/spine.lua @@ -163,7 +163,7 @@ function spine.Skeleton:updateWorldTransform() local indices = nil if slot.bone.active then - + local isClippingAttachment = false if attachment then if attachment.type == spine.AttachmentType.region then numVertices = 4 @@ -183,6 +183,7 @@ function spine.Skeleton:updateWorldTransform() blendMode = toCoronaBlendMode(slot.data.blendMode) elseif attachment.type == spine.AttachmentType.clipping then self.clipper:clipStart(slot, attachment) + isClippingAttachment = true end if texture and vertices and indices then @@ -222,9 +223,9 @@ function spine.Skeleton:updateWorldTransform() end self:batch(vertices, uvs, numVertices, indices, groupVertices, groupUvs, groupIndices) - end - self.clipper:clipEnd(slot) + end + if not isClippingAttachment then self.clipper:clipEnd(slot) end end end end