mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[libgdx] Fixed path constraint computations being invalid if a path's length is ever NaN.
This commit is contained in:
parent
91a1dc4ece
commit
e6acc6725b
@ -208,7 +208,7 @@ public class PathConstraint implements Constraint {
|
|||||||
float pathLength = lengths[curveCount];
|
float pathLength = lengths[curveCount];
|
||||||
if (percentPosition) position *= pathLength;
|
if (percentPosition) position *= pathLength;
|
||||||
if (percentSpacing) {
|
if (percentSpacing) {
|
||||||
for (int i = 0; i < spacesCount; i++)
|
for (int i = 1; i < spacesCount; i++)
|
||||||
spaces[i] *= pathLength;
|
spaces[i] *= pathLength;
|
||||||
}
|
}
|
||||||
world = this.world.setSize(8);
|
world = this.world.setSize(8);
|
||||||
@ -319,7 +319,7 @@ public class PathConstraint implements Constraint {
|
|||||||
else
|
else
|
||||||
position *= pathLength / path.getLengths()[curveCount - 1];
|
position *= pathLength / path.getLengths()[curveCount - 1];
|
||||||
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