mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Bug: hitTest is broken for empty animation (#832)
This commit is contained in:
parent
4502a432da
commit
7a2547831a
@ -184,6 +184,7 @@ public class SkeletonSprite extends DisplayObject {
|
||||
var maxX:Number = -Number.MAX_VALUE, maxY:Number = -Number.MAX_VALUE;
|
||||
var slots:Vector.<Slot> = skeleton.slots;
|
||||
var worldVertices:Vector.<Number> = _tempVertices;
|
||||
var empty:Boolean = true;
|
||||
for (var i:int = 0, n:int = slots.length; i < n; ++i) {
|
||||
var slot:Slot = slots[i];
|
||||
var attachment:Attachment = slot.attachment;
|
||||
@ -200,6 +201,10 @@ public class SkeletonSprite extends DisplayObject {
|
||||
mesh.computeWorldVertices(slot, worldVertices);
|
||||
} else
|
||||
continue;
|
||||
|
||||
if (verticesLength != 0)
|
||||
empty = false;
|
||||
|
||||
for (var ii:int = 0; ii < verticesLength; ii += 2) {
|
||||
var x:Number = worldVertices[ii], y:Number = worldVertices[ii + 1];
|
||||
minX = minX < x ? minX : x;
|
||||
@ -208,6 +213,9 @@ public class SkeletonSprite extends DisplayObject {
|
||||
maxY = maxY > y ? maxY : y;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty)
|
||||
return null;
|
||||
|
||||
var temp:Number;
|
||||
if (maxX < minX) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user