mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-04 06:39:09 +08:00
Bug fixes.
This commit is contained in:
parent
11266e0cc5
commit
c4a3de0e7f
@ -116,7 +116,7 @@ function SkeletonBounds.new ()
|
|||||||
|
|
||||||
function self:intersectsSegment (x1, y1, x2, y2)
|
function self:intersectsSegment (x1, y1, x2, y2)
|
||||||
for i,polygon in ipairs(self.polygons) do
|
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
|
end
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
@ -138,7 +138,7 @@ function SkeletonBounds.new ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function self:polygonIntersectsSegment (polygon, x1, y1, x2, y2)
|
function self:polygonIntersectsSegment (polygon, x1, y1, x2, y2)
|
||||||
local nn = polygon.length
|
local nn = #polygon
|
||||||
local width12, height12 = x1 - x2, y1 - y2
|
local width12, height12 = x1 - x2, y1 - y2
|
||||||
local det1 = x1 * y2 - y1 * x2
|
local det1 = x1 * y2 - y1 * x2
|
||||||
local x3, y3 = polygon[nn - 2], polygon[nn - 1]
|
local x3, y3 = polygon[nn - 2], polygon[nn - 1]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user