mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
[haxe] Fix bone inherit. Closes #2664.
This commit is contained in:
parent
97a83c2430
commit
c6eaac2b1f
@ -152,7 +152,7 @@ class Bone implements Updatable {
|
|||||||
worldX = pa * x + pb * y + parent.worldX;
|
worldX = pa * x + pb * y + parent.worldX;
|
||||||
worldY = pc * x + pd * y + parent.worldY;
|
worldY = pc * x + pd * y + parent.worldY;
|
||||||
|
|
||||||
switch (data.inherit) {
|
switch (inherit) {
|
||||||
case Inherit.normal:
|
case Inherit.normal:
|
||||||
var rx:Float = (rotation + shearX) * MathUtils.degRad;
|
var rx:Float = (rotation + shearX) * MathUtils.degRad;
|
||||||
var ry:Float = (rotation + 90 + shearY) * MathUtils.degRad;
|
var ry:Float = (rotation + 90 + shearY) * MathUtils.degRad;
|
||||||
@ -211,7 +211,7 @@ class Bone implements Updatable {
|
|||||||
za *= s;
|
za *= s;
|
||||||
zc *= s;
|
zc *= s;
|
||||||
s = Math.sqrt(za * za + zc * zc);
|
s = Math.sqrt(za * za + zc * zc);
|
||||||
if (data.inherit == Inherit.noScale && ((pa * pd - pb * pc < 0) != ((sx < 0) != (sy < 0)))) {
|
if (inherit == Inherit.noScale && ((pa * pd - pb * pc < 0) != ((sx < 0) != (sy < 0)))) {
|
||||||
s = -s;
|
s = -s;
|
||||||
}
|
}
|
||||||
rotation = Math.PI / 2 + Math.atan2(zc, za);
|
rotation = Math.PI / 2 + Math.atan2(zc, za);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user