Fixed a bug where ffd would never be used. (#602)

Float32Array.length is read only and will not resize the array. This caused the .length to always be 0 and thus not use ffd in spine.WeightedMeshAttachment.computerWorldVertices(). This proposed fix instead creates a new array when the size has changed.
This commit is contained in:
olssonfredrik 2016-06-06 14:13:58 +02:00 committed by Nathan Sweet
parent 1ea57900c5
commit 1f4b6b1508

View File

@ -989,8 +989,11 @@ spine.FfdTimeline.prototype = {
var vertexCount = frameVertices[0].length; var vertexCount = frameVertices[0].length;
var vertices = slot.attachmentVertices; var vertices = slot.attachmentVertices;
if (vertices.length != vertexCount) alpha = 1; if (vertices.length != vertexCount) {
vertices = slot.attachmentVertices = new spine.Float32Array(vertexCount);
vertices.length = vertexCount; vertices.length = vertexCount;
alpha = 1;
}
if (time >= frames[frames.length - 1]) { // Time is after last frame. if (time >= frames[frames.length - 1]) { // Time is after last frame.
var lastVertices = frameVertices[frames.length - 1]; var lastVertices = frameVertices[frames.length - 1];