瀏覽代碼

Merge branch 'master' into dev

badlogic 9 年之前
父節點
當前提交
f5aba88921
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      spine-lua/Skeleton.lua

+ 3 - 1
spine-lua/Skeleton.lua

@@ -40,6 +40,8 @@ local Color = require "spine-lua.Color"
 local setmetatable = setmetatable
 local ipairs = ipairs
 local table_insert = table.insert
+local math_min = math.min
+local math_max = math.max
 
 local Skeleton = {}
 Skeleton.__index = Skeleton
@@ -481,7 +483,7 @@ function Skeleton:getBounds(offset, size)
 			for i, slot in ipairs(drawOrder) do
 				local vertices = nil
 				local attachment = slot.attachment
-				if attachment.type == AttachmentType.region or attachment.type == AttachmentType.mesh then
+				if attachment and (attachment.type == AttachmentType.region or attachment.type == AttachmentType.mesh) then
 					vertices = attachment:updateWorldVertices(slot, false);
 				end
 				if vertices then