Skip to content

Commit

Permalink
fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Matias committed May 29, 2013
1 parent f3d1467 commit 116ad3c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spine-corona/spine-corona/spine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ function spine.Skeleton.new (skeletonData, group)
image.y = -(slot.bone.worldY + attachment.x * slot.bone.m10 + attachment.y * slot.bone.m11)
image.rotation = -(slot.bone.worldRotation + attachment.rotation)

-- fix scaling when attachment is rotated 90 degrees
local rot = math.abs(attachment.rotation) % 180
if (rot == 90) then
image.xScale = slot.bone.worldScaleY * attachment.scaleX
image.yScale = slot.bone.worldScaleX * attachment.scaleY
else
--if (rot ~= 0 and (slot.bone.worldScaleX ~= 1 or slot.bone.worldScaleY ~= 1)) then print("WARNING: Scaling bones with attachments not rotated to the cardinal angles will not work as expected in Corona!") end
image.xScale = slot.bone.worldScaleX * attachment.scaleX
image.yScale = slot.bone.worldScaleY * attachment.scaleY
end
-- fix scaling when attachment is rotated 90 degrees
local rot = math.abs(attachment.rotation) % 180
if (rot == 90) then
image.xScale = slot.bone.worldScaleY * attachment.scaleX
image.yScale = slot.bone.worldScaleX * attachment.scaleY
else
--if (rot ~= 0 and (slot.bone.worldScaleX ~= 1 or slot.bone.worldScaleY ~= 1)) then print("WARNING: Scaling bones with attachments not rotated to the cardinal angles will not work as expected in Corona!") end
image.xScale = slot.bone.worldScaleX * attachment.scaleX
image.yScale = slot.bone.worldScaleY * attachment.scaleY
end

if self.flipX then
image.xScale = -image.xScale
Expand Down

0 comments on commit 116ad3c

Please sign in to comment.