Browse Source

[csharp] Port of commit d7203ee. Improved fix for TransformMode.noRotationOrReflection with skeleton scale. See #1668.

Harald Csaszar 5 years ago
parent
commit
0357dd5ffa
1 changed files with 3 additions and 1 deletions
  1. 3 1
      spine-csharp/src/Bone.cs

+ 3 - 1
spine-csharp/src/Bone.cs

@@ -189,6 +189,8 @@ namespace Spine {
 					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;
@@ -207,7 +209,7 @@ namespace Spine {
 					b = pa * lb - pb * ld;
 					c = pc * la + pd * lc;
 					d = pc * lb + pd * ld;
-					return;
+					break;
 				}
 			case TransformMode.NoScale:
 			case TransformMode.NoScaleOrReflection: {