mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[csharp] Fix PathConstraint spacing.
This commit is contained in:
parent
936a7b048f
commit
4b2fb3eedf
@ -66,6 +66,7 @@ namespace Spine {
|
|||||||
translateMix = data.translateMix;
|
translateMix = data.translateMix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Applies the constraint to the constrained bones.</summary>
|
||||||
public void Apply () {
|
public void Apply () {
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
@ -95,8 +96,8 @@ namespace Spine {
|
|||||||
if (setupLength == 0) setupLength = 0.000000001f;
|
if (setupLength == 0) setupLength = 0.000000001f;
|
||||||
float x = setupLength * bone.a, y = setupLength * bone.c;
|
float x = setupLength * bone.a, y = setupLength * bone.c;
|
||||||
float length = (float)Math.Sqrt(x * x + y * y);
|
float length = (float)Math.Sqrt(x * x + y * y);
|
||||||
if (scale) lengths.Items[i] = setupLength;
|
if (scale) lengths.Items[i] = length;
|
||||||
spaces.Items[++i] = (lengthSpacing ? Math.Max(0, setupLength + spacing) : spacing) * length / setupLength;
|
spaces.Items[++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