mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[ts] Fix applying attachment timeline in AnimationState
AnimatinState.setAttachment was directly setting the slot.attachment field instead of calling the setter. This caused the deform array from a previous attachment to linger around and be applied to the current attachment incorrectly.
This commit is contained in:
parent
97b3f3058b
commit
bef00617d7
@ -1611,7 +1611,7 @@ var spine;
|
|||||||
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
||||||
};
|
};
|
||||||
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
||||||
slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
|
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
|
||||||
if (attachments)
|
if (attachments)
|
||||||
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
||||||
};
|
};
|
||||||
@ -4103,17 +4103,11 @@ var spine;
|
|||||||
var mesh = attachment;
|
var mesh = attachment;
|
||||||
verticesLength = mesh.worldVerticesLength;
|
verticesLength = mesh.worldVerticesLength;
|
||||||
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
||||||
if (i == 43) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||||
}
|
}
|
||||||
if (vertices != null) {
|
if (vertices != null) {
|
||||||
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
||||||
var x = vertices[ii], y = vertices[ii + 1];
|
var x = vertices[ii], y = vertices[ii + 1];
|
||||||
if (isNaN(x) || isNaN(y)) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
minX = Math.min(minX, x);
|
minX = Math.min(minX, x);
|
||||||
minY = Math.min(minY, y);
|
minY = Math.min(minY, y);
|
||||||
maxX = Math.max(maxX, x);
|
maxX = Math.max(maxX, x);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1611,7 +1611,7 @@ var spine;
|
|||||||
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
||||||
};
|
};
|
||||||
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
||||||
slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
|
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
|
||||||
if (attachments)
|
if (attachments)
|
||||||
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
||||||
};
|
};
|
||||||
@ -4103,17 +4103,11 @@ var spine;
|
|||||||
var mesh = attachment;
|
var mesh = attachment;
|
||||||
verticesLength = mesh.worldVerticesLength;
|
verticesLength = mesh.worldVerticesLength;
|
||||||
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
||||||
if (i == 43) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||||
}
|
}
|
||||||
if (vertices != null) {
|
if (vertices != null) {
|
||||||
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
||||||
var x = vertices[ii], y = vertices[ii + 1];
|
var x = vertices[ii], y = vertices[ii + 1];
|
||||||
if (isNaN(x) || isNaN(y)) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
minX = Math.min(minX, x);
|
minX = Math.min(minX, x);
|
||||||
minY = Math.min(minY, y);
|
minY = Math.min(minY, y);
|
||||||
maxX = Math.max(maxX, x);
|
maxX = Math.max(maxX, x);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1611,7 +1611,7 @@ var spine;
|
|||||||
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
||||||
};
|
};
|
||||||
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
||||||
slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
|
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
|
||||||
if (attachments)
|
if (attachments)
|
||||||
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
||||||
};
|
};
|
||||||
@ -4103,17 +4103,11 @@ var spine;
|
|||||||
var mesh = attachment;
|
var mesh = attachment;
|
||||||
verticesLength = mesh.worldVerticesLength;
|
verticesLength = mesh.worldVerticesLength;
|
||||||
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
||||||
if (i == 43) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||||
}
|
}
|
||||||
if (vertices != null) {
|
if (vertices != null) {
|
||||||
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
||||||
var x = vertices[ii], y = vertices[ii + 1];
|
var x = vertices[ii], y = vertices[ii + 1];
|
||||||
if (isNaN(x) || isNaN(y)) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
minX = Math.min(minX, x);
|
minX = Math.min(minX, x);
|
||||||
minY = Math.min(minY, y);
|
minY = Math.min(minY, y);
|
||||||
maxX = Math.max(maxX, x);
|
maxX = Math.max(maxX, x);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1611,7 +1611,7 @@ var spine;
|
|||||||
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
||||||
};
|
};
|
||||||
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
||||||
slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
|
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
|
||||||
if (attachments)
|
if (attachments)
|
||||||
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
||||||
};
|
};
|
||||||
@ -4103,17 +4103,11 @@ var spine;
|
|||||||
var mesh = attachment;
|
var mesh = attachment;
|
||||||
verticesLength = mesh.worldVerticesLength;
|
verticesLength = mesh.worldVerticesLength;
|
||||||
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
||||||
if (i == 43) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||||
}
|
}
|
||||||
if (vertices != null) {
|
if (vertices != null) {
|
||||||
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
||||||
var x = vertices[ii], y = vertices[ii + 1];
|
var x = vertices[ii], y = vertices[ii + 1];
|
||||||
if (isNaN(x) || isNaN(y)) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
minX = Math.min(minX, x);
|
minX = Math.min(minX, x);
|
||||||
minY = Math.min(minY, y);
|
minY = Math.min(minY, y);
|
||||||
maxX = Math.max(maxX, x);
|
maxX = Math.max(maxX, x);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1611,7 +1611,7 @@ var spine;
|
|||||||
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
||||||
};
|
};
|
||||||
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
||||||
slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
|
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
|
||||||
if (attachments)
|
if (attachments)
|
||||||
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
||||||
};
|
};
|
||||||
@ -4103,17 +4103,11 @@ var spine;
|
|||||||
var mesh = attachment;
|
var mesh = attachment;
|
||||||
verticesLength = mesh.worldVerticesLength;
|
verticesLength = mesh.worldVerticesLength;
|
||||||
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
||||||
if (i == 43) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||||
}
|
}
|
||||||
if (vertices != null) {
|
if (vertices != null) {
|
||||||
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
||||||
var x = vertices[ii], y = vertices[ii + 1];
|
var x = vertices[ii], y = vertices[ii + 1];
|
||||||
if (isNaN(x) || isNaN(y)) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
minX = Math.min(minX, x);
|
minX = Math.min(minX, x);
|
||||||
minY = Math.min(minY, y);
|
minY = Math.min(minY, y);
|
||||||
maxX = Math.max(maxX, x);
|
maxX = Math.max(maxX, x);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1611,7 +1611,7 @@ var spine;
|
|||||||
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
slot.attachmentState = this.unkeyedState + AnimationState.SETUP;
|
||||||
};
|
};
|
||||||
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {
|
||||||
slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
|
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
|
||||||
if (attachments)
|
if (attachments)
|
||||||
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
||||||
};
|
};
|
||||||
@ -4103,17 +4103,11 @@ var spine;
|
|||||||
var mesh = attachment;
|
var mesh = attachment;
|
||||||
verticesLength = mesh.worldVerticesLength;
|
verticesLength = mesh.worldVerticesLength;
|
||||||
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
vertices = spine.Utils.setArraySize(temp, verticesLength, 0);
|
||||||
if (i == 43) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);
|
||||||
}
|
}
|
||||||
if (vertices != null) {
|
if (vertices != null) {
|
||||||
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {
|
||||||
var x = vertices[ii], y = vertices[ii + 1];
|
var x = vertices[ii], y = vertices[ii + 1];
|
||||||
if (isNaN(x) || isNaN(y)) {
|
|
||||||
console.log("WTF");
|
|
||||||
}
|
|
||||||
minX = Math.min(minX, x);
|
minX = Math.min(minX, x);
|
||||||
minY = Math.min(minY, y);
|
minY = Math.min(minY, y);
|
||||||
maxX = Math.max(maxX, x);
|
maxX = Math.max(maxX, x);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -378,7 +378,7 @@ module spine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string, attachments: boolean) {
|
setAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string, attachments: boolean) {
|
||||||
slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);
|
slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
|
||||||
if (attachments) slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
if (attachments) slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user