Fixed images not being removed correctly.

This commit is contained in:
NathanSweet 2013-10-22 11:42:10 +02:00
parent a9315d46f3
commit 9f6fd34389

View File

@ -90,19 +90,18 @@ function spine.Skeleton.new (skeletonData, group)
local updateWorldTransform_super = self.updateWorldTransform
function self:updateWorldTransform ()
updateWorldTransform_super(self)
local images = self.images
local images = self.images
local skeletonR, skeletonG, skeletonB, skeletonA = self.r * 255, self.g * 255, self.b * 255, self.a
for i,slot in ipairs(self.drawOrder) do
local attachment = slot.attachment
if attachment and attachment.type == spine.AttachmentType.region then
local image = images[slot]
local attachment = slot.attachment
if not attachment then -- Attachment is gone, remove the image.
if image then
image:removeSelf()
images[slot] = nil
end
else
elseif attachment.type == spine.AttachmentType.region then
if image and image.attachment ~= attachment then -- Attachment image has changed.
if self:modifyImage(image, attachment) then
image.lastR, image.lastA = nil, nil
@ -190,7 +189,6 @@ function spine.Skeleton.new (skeletonData, group)
end
end
end
end
if self.debug then
for i,bone in ipairs(self.bones) do