Don't mix from uninitialized slot vertices.

One less and more correct check.
This commit is contained in:
John 2016-03-29 07:26:57 +08:00
parent 17ba6e2354
commit 27bab7bb95

View File

@ -582,10 +582,9 @@ namespace Spine {
int vertexCount = frameVertices[0].Length; int vertexCount = frameVertices[0].Length;
float[] vertices = slot.attachmentVertices; float[] vertices = slot.attachmentVertices;
if (slot.attachmentVerticesCount != vertexCount) alpha = 1; // Don't mix from uninitialized slot vertices.
// Don't mix from uninitialized slot vertices. // Ensure capacity
if (slot.attachmentVerticesCount == 0 || vertices.Length != vertexCount) alpha = 1;
if (vertices.Length < vertexCount) { if (vertices.Length < vertexCount) {
vertices = new float[vertexCount]; vertices = new float[vertexCount];
slot.attachmentVertices = vertices; slot.attachmentVertices = vertices;