[libgdx] Fixed path constraint when a parent bone of the path is scaled.

closes EsotericSoftware/spine-editor#499
This commit is contained in:
Nathan Sweet 2020-11-15 23:48:59 -08:00
parent 10d5a918ca
commit e14db0ec2c
2 changed files with 3 additions and 6 deletions

View File

@ -346,10 +346,7 @@ public class PathConstraint implements Updatable {
y1 = y2;
}
if (data.positionMode == PositionMode.percent)
position *= pathLength;
else
position *= pathLength / path.getLengths()[curveCount - 1];
if (data.positionMode == PositionMode.percent) position *= pathLength;
float multiplier;
switch (data.spacingMode) {

View File

@ -58,8 +58,8 @@ public class PathAttachment extends VertexAttachment {
this.closed = closed;
}
/** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer
* calculations are performed but calculating positions along the path is less accurate. */
/** If true, additional calculations are performed to make computing positions along the path more accurate and movement along
* the path have a constant speed. */
public boolean getConstantSpeed () {
return constantSpeed;
}