Merge branch '4.1-beta' into 4.2-beta

# Conflicts:
#	spine-ts/package-lock.json
#	spine-ts/package.json
#	spine-ts/spine-canvas/package.json
#	spine-ts/spine-core/package.json
#	spine-ts/spine-player/package.json
#	spine-ts/spine-threejs/package.json
#	spine-ts/spine-webgl/package.json
This commit is contained in:
Mario Zechner 2022-06-22 14:12:23 +02:00
commit 4cc9cfa94f
6 changed files with 11 additions and 10 deletions

View File

@ -1510,7 +1510,7 @@ export class DeformTimeline extends CurveTimeline implements SlotTimeline {
if (!slot.bone.active) return;
let slotAttachment: Attachment | null = slot.getAttachment();
if (!slotAttachment) return;
if (!(slotAttachment instanceof VertexAttachment) || (<VertexAttachment>slotAttachment).timelineAttahment != this.attachment) return;
if (!(slotAttachment instanceof VertexAttachment) || (<VertexAttachment>slotAttachment).timelineAttachment != this.attachment) return;
let deform: Array<number> = slot.deform;
if (deform.length == 0) blend = MixBlend.setup;
@ -2195,7 +2195,7 @@ export class SequenceTimeline extends Timeline implements SlotTimeline {
let attachment = this.attachment as unknown as Attachment;
if (slotAttachment != attachment) {
if (!(slotAttachment instanceof VertexAttachment)
|| (slotAttachment as VertexAttachment).timelineAttahment != attachment) return;
|| (slotAttachment as VertexAttachment).timelineAttachment != attachment) return;
}
let frames = this.frames;
@ -2209,6 +2209,7 @@ export class SequenceTimeline extends Timeline implements SlotTimeline {
let modeAndIndex = frames[i + SequenceTimeline.MODE];
let delay = frames[i + SequenceTimeline.DELAY];
if (!this.attachment.sequence) return;
let index = modeAndIndex >> 4, count = this.attachment.sequence!.regions.length;
let mode = SequenceModeValues[modeAndIndex & 0xf];
if (mode != SequenceMode.hold) {
@ -2222,7 +2223,7 @@ export class SequenceTimeline extends Timeline implements SlotTimeline {
break;
case SequenceMode.pingpong: {
let n = (count << 1) - 2;
index %= n;
index = n == 0 ? 0 : index % n;
if (index >= count) index = n - index;
break;
}
@ -2234,7 +2235,7 @@ export class SequenceTimeline extends Timeline implements SlotTimeline {
break;
case SequenceMode.pingpongReverse: {
let n = (count << 1) - 2;
index = (index + count - 1) % n;
index = n == 0 ? 0 : (index + count - 1) % n;
if (index >= count) index = n - index;
}
}

View File

@ -238,7 +238,7 @@ export class SkeletonBinary {
if (!linkedMesh.parent) throw new Error("Linked mesh parent must not be null");
let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
if (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? parent as VertexAttachment : linkedMesh.mesh;
linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent as VertexAttachment : linkedMesh.mesh;
linkedMesh.mesh.setParentMesh(parent as MeshAttachment);
if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();
}

View File

@ -297,7 +297,7 @@ export class SkeletonJson {
if (!skin) throw new Error(`Skin not found: ${linkedMesh.skin}`);
let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);
if (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);
linkedMesh.mesh.timelineAttahment = linkedMesh.inheritTimeline ? <VertexAttachment>parent : <VertexAttachment>linkedMesh.mesh;
linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? <VertexAttachment>parent : <VertexAttachment>linkedMesh.mesh;
linkedMesh.mesh.setParentMesh(<MeshAttachment>parent);
if (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();
}

View File

@ -91,7 +91,7 @@ export class Slot {
setAttachment (attachment: Attachment | null) {
if (this.attachment == attachment) return;
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)
|| (<VertexAttachment>attachment).timelineAttahment != (<VertexAttachment>this.attachment).timelineAttahment) {
|| (<VertexAttachment>attachment).timelineAttachment != (<VertexAttachment>this.attachment).timelineAttachment) {
this.deform.length = 0;
}
this.attachment = attachment;

View File

@ -66,7 +66,7 @@ export abstract class VertexAttachment extends Attachment {
/** Timelines for the timeline attachment are also applied to this attachment.
* May be null if no attachment-specific timelines should be applied. */
timelineAttahment: Attachment = this;
timelineAttachment: Attachment = this;
constructor (name: string) {
super(name);
@ -155,6 +155,6 @@ export abstract class VertexAttachment extends Attachment {
}
attachment.worldVerticesLength = this.worldVerticesLength;
attachment.timelineAttahment = this.timelineAttahment;
attachment.timelineAttachment = this.timelineAttachment;
}
}

View File

@ -205,7 +205,7 @@ export class MeshAttachment extends VertexAttachment implements HasTextureRegion
let copy = new MeshAttachment(this.name, this.path);
copy.region = this.region;
copy.color.setFromColor(this.color);
copy.timelineAttahment = this.timelineAttahment;
copy.timelineAttachment = this.timelineAttachment;
copy.setParentMesh(this.parentMesh ? this.parentMesh : this);
if (copy.region != null) copy.updateRegion();
return copy;