mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Better scale sign computation.
This commit is contained in:
parent
5edeeb6035
commit
e4e312626b
@ -397,9 +397,9 @@ public class Animation {
|
|||||||
} else {
|
} else {
|
||||||
x *= bone.data.scaleX;
|
x *= bone.data.scaleX;
|
||||||
y *= bone.data.scaleY;
|
y *= bone.data.scaleY;
|
||||||
float bx = Math.abs(bone.scaleX), by = Math.abs(bone.scaleY);
|
float bx = Math.abs(bone.scaleX) * Math.signum(x), by = Math.abs(bone.scaleY) * Math.signum(y);
|
||||||
bone.scaleX = (bx + (Math.abs(x) - bx) * alpha) * Math.signum(x);
|
bone.scaleX = (bx + (x - bx) * alpha);
|
||||||
bone.scaleY = (by + (Math.abs(y) - by) * alpha) * Math.signum(y);
|
bone.scaleY = (by + (y - by) * alpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user