From 28dc5dd2e8d33d816ecdc48cc505083e5d39fe50 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 2 Feb 2022 12:04:26 +0100 Subject: [PATCH] [ts] Fix bugs in ported code for #2027 --- spine-ts/spine-core/src/AnimationState.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spine-ts/spine-core/src/AnimationState.ts b/spine-ts/spine-core/src/AnimationState.ts index b9c3fca2a..4e01a3b43 100644 --- a/spine-ts/spine-core/src/AnimationState.ts +++ b/spine-ts/spine-core/src/AnimationState.ts @@ -279,6 +279,7 @@ export class AnimationState { let shortestRotation = from.shortestRotation; let firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1; + if (firstFrame) from.timelinesRotation.length = timelineCount << 1; from.totalAlpha = 0; for (let i = 0; i < timelineCount; i++) { @@ -312,7 +313,7 @@ export class AnimationState { } from.totalAlpha += alpha; - if (shortestRotation && timeline instanceof RotateTimeline) + if (!shortestRotation && timeline instanceof RotateTimeline) this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame); else if (timeline instanceof AttachmentTimeline) this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments);