From c4a3de0e7fc9529fb775a96b9c5c60deff458f0b Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Mon, 17 Mar 2014 18:42:58 +0100 Subject: [PATCH] Bug fixes. --- spine-lua/SkeletonBounds.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-lua/SkeletonBounds.lua b/spine-lua/SkeletonBounds.lua index 65f2f615e..1463cb820 100644 --- a/spine-lua/SkeletonBounds.lua +++ b/spine-lua/SkeletonBounds.lua @@ -116,7 +116,7 @@ function SkeletonBounds.new () function self:intersectsSegment (x1, y1, x2, y2) for i,polygon in ipairs(self.polygons) do - if self:polygonIntersectsSegment(polygon, x1, y1, x2, y2) then return boundingBoxes[i] end + if self:polygonIntersectsSegment(polygon, x1, y1, x2, y2) then return self.boundingBoxes[i] end end return nil end @@ -138,7 +138,7 @@ function SkeletonBounds.new () end function self:polygonIntersectsSegment (polygon, x1, y1, x2, y2) - local nn = polygon.length + local nn = #polygon local width12, height12 = x1 - x2, y1 - y2 local det1 = x1 * y2 - y1 * x2 local x3, y3 = polygon[nn - 2], polygon[nn - 1]