Fixed timeline frame count and bounding box AABB.

closes #531
This commit is contained in:
NathanSweet 2016-04-04 15:00:15 +02:00
parent 56abccb508
commit afecae737a

View File

@ -2057,7 +2057,7 @@ spine.SkeletonJson.prototype = {
frameIndex++;
}
timelines.push(timeline);
duration = Math.max(duration, timeline.frames[timeline.frameCount * 3 - 3]);
duration = Math.max(duration, timeline.frames[timeline.getFrameCount() * 3 - 3]);
}
var ffd = map["ffd"];
@ -2118,7 +2118,7 @@ spine.SkeletonJson.prototype = {
frameIndex++;
}
timelines[timelines.length] = timeline;
duration = Math.max(duration, timeline.frames[timeline.frameCount - 1]);
duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);
}
}
}
@ -2535,7 +2535,7 @@ spine.SkeletonBounds.prototype = {
},
aabbCompute: function () {
var polygons = this.polygons;
var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE;
var minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, maxX = -Number.MAX_VALUE, maxY = -Number.MAX_VALUE;
for (var i = 0, n = polygons.length; i < n; i++) {
var vertices = polygons[i];
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {