Skip to content

Commit

Permalink
[lua] Fix applying flipping for noScale/noScaleOrReflection transform…
Browse files Browse the repository at this point in the history
… mode. See #951
  • Loading branch information
badlogic committed Jul 19, 2017
1 parent d2f6758 commit 4a69af1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions spine-lua/Bone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,16 @@ function Bone:updateWorldTransformWith (x, y, rotation, scaleX, scaleY, shearX,
local lb = math_cos(math_rad(90 + shearY)) * scaleY;
local lc = math_sin(math_rad(shearX)) * scaleX;
local ld = math_sin(90 + shearY) * scaleY;
self.a = za * la + zb * lc
self.b = za * lb + zb * ld
self.c = zc * la + zd * lc
self.d = zc * lb + zd * ld
local flip = self.skeleton.flipX ~= self.skeleton.flipY
if transformMode ~= TransformMode.noScaleOrReflection then flip = pa * pd - pb * pc < 0 end
if flip then
self.b = -self.b
self.d = -self.d
zb = -zb
zd = -zd
end
self.a = za * la + zb * lc
self.b = za * lb + zb * ld
self.c = zc * la + zd * lc
self.d = zc * lb + zd * ld
return
end

Expand Down

0 comments on commit 4a69af1

Please sign in to comment.