From e14db0ec2c0f105eedce836bae1ee61eb1dc60c2 Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Sun, 15 Nov 2020 23:48:59 -0800 Subject: [PATCH] [libgdx] Fixed path constraint when a parent bone of the path is scaled. closes EsotericSoftware/spine-editor#499 --- .../src/com/esotericsoftware/spine/PathConstraint.java | 5 +---- .../esotericsoftware/spine/attachments/PathAttachment.java | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java index a63276509..bf118e8be 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/PathConstraint.java @@ -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) { diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PathAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PathAttachment.java index 383bd4da8..6ad9bca34 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PathAttachment.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/PathAttachment.java @@ -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; }