[ts] Fix bugs in ported code for #2027

This commit is contained in:
Mario Zechner 2022-02-02 12:04:26 +01:00
parent ffb9e75b09
commit 28dc5dd2e8

View File

@ -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);