mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
Scale path spacing.
http://esotericsoftware.com/forum/Scaling-bone-messes-up-animation-order-7487?p=34659#p34659
This commit is contained in:
parent
a24fea41c0
commit
8e0972d732
@ -112,10 +112,10 @@ public class PathConstraint implements Constraint {
|
||||
if (scale) lengths = this.lengths.setSize(boneCount);
|
||||
for (int i = 0, n = spacesCount - 1; i < n;) {
|
||||
Bone bone = (Bone)bones[i];
|
||||
float length = bone.data.length, x = length * bone.a, y = length * bone.c;
|
||||
length = (float)Math.sqrt(x * x + y * y);
|
||||
float setupLength = bone.data.length, x = setupLength * bone.a, y = setupLength * bone.c;
|
||||
float length = (float)Math.sqrt(x * x + y * y);
|
||||
if (scale) lengths[i] = length;
|
||||
spaces[++i] = lengthSpacing ? Math.max(0, length + spacing) : spacing;
|
||||
spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength;
|
||||
}
|
||||
} else {
|
||||
for (int i = 1; i < spacesCount; i++)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user