From eff8b372f728cec13b7f1cf9496ad42cfc2a1a19 Mon Sep 17 00:00:00 2001 From: Luke Ingram Date: Wed, 26 Jan 2022 15:56:11 -0400 Subject: [PATCH] [lua] Port of additive scale mixing fix, see #2028 --- spine-lua/spine-lua/Animation.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spine-lua/spine-lua/Animation.lua b/spine-lua/spine-lua/Animation.lua index 62d5caec5..bbdb16dd4 100644 --- a/spine-lua/spine-lua/Animation.lua +++ b/spine-lua/spine-lua/Animation.lua @@ -566,8 +566,8 @@ function Animation.ScaleTimeline.new (frameCount, bezierCount, boneIndex) bone.scaleX = bx + (math_abs(x) * math_signum(bx) - bx) * alpha bone.scaleY = by + (math_abs(y) * math_signum(by) - by) * alpha elseif blend == MixBlend.add then - bone.scaleX = (x - bone.data.scaleX) * alpha - bone.scaleY = (y - bone.data.scaleY) * alpha + bone.scaleX = bone.scaleX + (x - bone.data.scaleX) * alpha + bone.scaleY = bone.scaleY + (y - bone.data.scaleY) * alpha end else if blend == MixBlend.setup then @@ -627,7 +627,7 @@ function Animation.ScaleXTimeline.new (frameCount, bezierCount, boneIndex) bx = bone.scaleX bone.scaleX = bx + (math_abs(x) * math_signum(bx) - bx) * alpha elseif blend == MixBlend.add then - bone.scaleX = (x - bone.data.scaleX) * alpha + bone.scaleX = bone.scaleX + (x - bone.data.scaleX) * alpha end else if blend == MixBlend.setup then @@ -682,7 +682,7 @@ function Animation.ScaleYTimeline.new (frameCount, bezierCount, boneIndex) by = bone.scaleY bone.scaleY = by + (math_abs(y) * math_signum(by) - by) * alpha elseif blend == MixBlend.add then - bone.scaleY = (y - bone.data.scaleY) * alpha + bone.scaleY = bone.scaleY + (y - bone.data.scaleY) * alpha end else if blend == MixBlend.setup then