mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +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);
|
if (scale) lengths = this.lengths.setSize(boneCount);
|
||||||
for (int i = 0, n = spacesCount - 1; i < n;) {
|
for (int i = 0, n = spacesCount - 1; i < n;) {
|
||||||
Bone bone = (Bone)bones[i];
|
Bone bone = (Bone)bones[i];
|
||||||
float length = bone.data.length, x = length * bone.a, y = length * bone.c;
|
float setupLength = bone.data.length, x = setupLength * bone.a, y = setupLength * bone.c;
|
||||||
length = (float)Math.sqrt(x * x + y * y);
|
float length = (float)Math.sqrt(x * x + y * y);
|
||||||
if (scale) lengths[i] = length;
|
if (scale) lengths[i] = length;
|
||||||
spaces[++i] = lengthSpacing ? Math.max(0, length + spacing) : spacing;
|
spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 1; i < spacesCount; i++)
|
for (int i = 1; i < spacesCount; i++)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user