mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Fixed issue #80.
This commit is contained in:
parent
dab2ee8f76
commit
2978da1eb2
@ -68,22 +68,11 @@ function spine.Skeleton.new (skeletonData, group)
|
|||||||
for i,slot in ipairs(self.drawOrder) do
|
for i,slot in ipairs(self.drawOrder) do
|
||||||
local attachment = slot.attachment
|
local attachment = slot.attachment
|
||||||
local image = images[attachment]
|
local image = images[attachment]
|
||||||
if not attachment then
|
if attachment then
|
||||||
-- Attachment is gone, remove the image.
|
|
||||||
if image then
|
|
||||||
images[attachment] = nil
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- Attachment image has changed.
|
|
||||||
if image and image.attachment ~= attachment then
|
|
||||||
image:removeSelf()
|
|
||||||
image = nil
|
|
||||||
end
|
|
||||||
-- Create new image.
|
-- Create new image.
|
||||||
if not image then
|
if not image then
|
||||||
image = self:createImage(attachment)
|
image = self:createImage(attachment)
|
||||||
if image then
|
if image then
|
||||||
image.attachment = attachment
|
|
||||||
local imageWidth = image:getWidth()
|
local imageWidth = image:getWidth()
|
||||||
local imageHeight = image:getHeight()
|
local imageHeight = image:getHeight()
|
||||||
attachment.widthRatio = attachment.width / imageWidth
|
attachment.widthRatio = attachment.width / imageWidth
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user