mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[c][cpp] Fix path constraint for when path length is NaN.
This commit is contained in:
parent
55f4a2968b
commit
503cdb81f4
@ -267,7 +267,7 @@ float* spPathConstraint_computeWorldPositions(spPathConstraint* self, spPathAtta
|
|||||||
pathLength = lengths[curveCount];
|
pathLength = lengths[curveCount];
|
||||||
if (percentPosition) position *= pathLength;
|
if (percentPosition) position *= pathLength;
|
||||||
if (percentSpacing) {
|
if (percentSpacing) {
|
||||||
for (i = 0; i < spacesCount; i++)
|
for (i = 1; i < spacesCount; i++)
|
||||||
spaces[i] *= pathLength;
|
spaces[i] *= pathLength;
|
||||||
}
|
}
|
||||||
if (self->worldCount != 8) {
|
if (self->worldCount != 8) {
|
||||||
@ -397,7 +397,7 @@ float* spPathConstraint_computeWorldPositions(spPathConstraint* self, spPathAtta
|
|||||||
else
|
else
|
||||||
position *= pathLength / path->lengths[curveCount - 1];
|
position *= pathLength / path->lengths[curveCount - 1];
|
||||||
if (percentSpacing) {
|
if (percentSpacing) {
|
||||||
for (i = 0; i < spacesCount; i++)
|
for (i = 1; i < spacesCount; i++)
|
||||||
spaces[i] *= pathLength;
|
spaces[i] *= pathLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -288,7 +288,7 @@ PathConstraint::computeWorldPositions(PathAttachment &path, int spacesCount, boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (percentSpacing) {
|
if (percentSpacing) {
|
||||||
for (int i = 0; i < spacesCount; ++i) {
|
for (int i = 1; i < spacesCount; ++i) {
|
||||||
_spaces[i] *= pathLength;
|
_spaces[i] *= pathLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -417,7 +417,7 @@ PathConstraint::computeWorldPositions(PathAttachment &path, int spacesCount, boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (percentSpacing) {
|
if (percentSpacing) {
|
||||||
for (int i = 0; i < spacesCount; ++i) {
|
for (int i = 1; i < spacesCount; ++i) {
|
||||||
_spaces[i] *= pathLength;
|
_spaces[i] *= pathLength;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user