From d618a639aaa379f54c0c56e1837b3c48a158b41e Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 11 Jun 2019 15:35:16 +0200 Subject: [PATCH] [lua] Ported active bone check in SkeletonBounds. See #1378. --- spine-lua/SkeletonBounds.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/spine-lua/SkeletonBounds.lua b/spine-lua/SkeletonBounds.lua index 2c51cbcb5..d59fe5e93 100644 --- a/spine-lua/SkeletonBounds.lua +++ b/spine-lua/SkeletonBounds.lua @@ -59,16 +59,18 @@ function SkeletonBounds:update (skeleton, updateAabb) local slots = skeleton.slots for _,slot in ipairs(skeleton.slots) do - local attachment = slot.attachment - if attachment and attachment.type == AttachmentType.boundingbox then - local boundingBox = attachment - table_insert(boundingBoxes, boundingBox) + if (slot.bone.active) then + local attachment = slot.attachment + if attachment and attachment.type == AttachmentType.boundingbox then + local boundingBox = attachment + table_insert(boundingBoxes, boundingBox) - local polygon = {} - table_insert(polygons, polygon) + local polygon = {} + table_insert(polygons, polygon) - boundingBox:computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2) - end + boundingBox:computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2) + end + end end if updateAabb then