Skip to content

Commit

Permalink
[lua] Port of additive scale mixing fix, see EsotericSoftware#2028
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeeingram committed Jan 26, 2022
1 parent 65c62bf commit eff8b37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spine-lua/spine-lua/Animation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eff8b37

Please sign in to comment.