[csharp] Port of commit c11afb2, see #2412. Take skeleton scale into account when applying translation only IK constraint.

This commit is contained in:
Harald Csaszar 2023-11-28 13:40:03 +01:00
parent 5d4b86e070
commit 907166572b

View File

@ -168,8 +168,8 @@ namespace Spine {
switch (bone.data.transformMode) {
case TransformMode.OnlyTranslation:
tx = targetX - bone.worldX;
ty = targetY - bone.worldY;
tx = (targetX - bone.worldX) * Math.Sign(bone.skeleton.ScaleX);
ty = (targetY - bone.worldY) * Math.Sign(bone.skeleton.ScaleY);
break;
case TransformMode.NoRotationOrReflection: {
float s = Math.Abs(pa * pd - pb * pc) / Math.Max(0.0001f, pa * pa + pc * pc);