|
@@ -182,7 +182,9 @@ namespace Spine {
|
|
}
|
|
}
|
|
default: {
|
|
default: {
|
|
float x = targetX - p.worldX, y = targetY - p.worldY;
|
|
float x = targetX - p.worldX, y = targetY - p.worldY;
|
|
- float d = Math.Max(0.0001f, pa * pd - pb * pc);
|
|
|
|
|
|
+ float d = pa * pd - pb * pc;
|
|
|
|
+ if (d > 0) d = Math.Max(0.0001f, d);
|
|
|
|
+ else d = Math.Min(-0.0001f, d);
|
|
tx = (x * pd - y * pb) / d - bone.ax;
|
|
tx = (x * pd - y * pb) / d - bone.ax;
|
|
ty = (y * pa - x * pc) / d - bone.ay;
|
|
ty = (y * pa - x * pc) / d - bone.ay;
|
|
break;
|
|
break;
|
|
@@ -256,7 +258,9 @@ namespace Spine {
|
|
b = pp.b;
|
|
b = pp.b;
|
|
c = pp.c;
|
|
c = pp.c;
|
|
d = pp.d;
|
|
d = pp.d;
|
|
- float id = 1 / Math.Max(0.0001f, a * d - b * c), x = cwx - pp.worldX, y = cwy - pp.worldY;
|
|
|
|
|
|
+ float id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY;
|
|
|
|
+ if (id > 0) id = 1 / Math.Max(0.0001f, id);
|
|
|
|
+ else id = 1 / Math.Min(-0.0001f, id);
|
|
float dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;
|
|
float dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;
|
|
float l1 = (float)Math.Sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;
|
|
float l1 = (float)Math.Sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;
|
|
if (l1 < 0.0001f) {
|
|
if (l1 < 0.0001f) {
|