From ee7411f2eca80bd27725b148f85a1702fb46270b Mon Sep 17 00:00:00 2001 From: badlogic Date: Mon, 30 Oct 2017 14:23:09 +0100 Subject: [PATCH] [ts] Disallow additive on track 0, fix scale timeline. --- spine-ts/core/src/Animation.ts | 6 ++++-- spine-ts/core/src/AnimationState.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/spine-ts/core/src/Animation.ts b/spine-ts/core/src/Animation.ts index 1eeddc748..db7e64640 100644 --- a/spine-ts/core/src/Animation.ts +++ b/spine-ts/core/src/Animation.ts @@ -428,8 +428,10 @@ module spine { break; case MixBlend.first: case MixBlend.replace: - bone.scaleX += (x - bone.scaleX * MathUtils.signum(x)) * alpha; - bone.scaleY += (y - bone.scaleY * MathUtils.signum(y)) * alpha; + bx = Math.abs(bone.scaleX) * MathUtils.signum(x); + by = Math.abs(bone.scaleY) * MathUtils.signum(y); + bone.scaleX = bx + (x - bx) * alpha; + bone.scaleY = by + (y - by) * alpha; break; case MixBlend.add: bx = MathUtils.signum(x); diff --git a/spine-ts/core/src/AnimationState.ts b/spine-ts/core/src/AnimationState.ts index 8347ac11d..e91c51a46 100644 --- a/spine-ts/core/src/AnimationState.ts +++ b/spine-ts/core/src/AnimationState.ts @@ -550,7 +550,7 @@ module spine { for (var i = 0, n = this.tracks.length; i < n; i++) { let entry = this.tracks[i]; - if (entry != null && entry.mixBlend != MixBlend.add) entry.setTimelineData(null, mixingTo, propertyIDs); + if (entry != null && (i == 0 || entry.mixBlend != MixBlend.add)) entry.setTimelineData(null, mixingTo, propertyIDs); } }