Skip to content

Commit

Permalink
[csharp] Port of commit d7203ee. Improved fix for TransformMode.noRot…
Browse files Browse the repository at this point in the history
…ationOrReflection with skeleton scale. See EsotericSoftware#1668.
  • Loading branch information
HaraldCsaszar committed May 20, 2020
1 parent f3a9c0a commit 0357dd5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spine-csharp/src/Bone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ public void UpdateWorldTransform (float x, float y, float rotation, float scaleX
float s = pa * pa + pc * pc, prx;
if (s > 0.0001f) {
s = Math.Abs(pa * pd - pb * pc) / s;
pa /= skeleton.ScaleX;
pc /= skeleton.ScaleY;
pb = pc * s;
pd = pa * s;
prx = MathUtils.Atan2(pc, pa) * MathUtils.RadDeg;
Expand All @@ -207,7 +209,7 @@ public void UpdateWorldTransform (float x, float y, float rotation, float scaleX
b = pa * lb - pb * ld;
c = pc * la + pd * lc;
d = pc * lb + pd * ld;
return;
break;
}
case TransformMode.NoScale:
case TransformMode.NoScaleOrReflection: {
Expand Down

0 comments on commit 0357dd5

Please sign in to comment.