From 258215ec06f17545f230f3af85c7548b13e6a369 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Sat, 15 Dec 2018 22:56:41 +0100 Subject: [PATCH] [csharp] Fixed path constraint computations being invalid if a path's length is ever NaN. See #1230 --- spine-csharp/src/PathConstraint.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-csharp/src/PathConstraint.cs b/spine-csharp/src/PathConstraint.cs index c0bc699ab..51f202c94 100644 --- a/spine-csharp/src/PathConstraint.cs +++ b/spine-csharp/src/PathConstraint.cs @@ -191,7 +191,7 @@ namespace Spine { pathLength = lengths[curveCount]; if (percentPosition) position *= pathLength; if (percentSpacing) { - for (int i = 0; i < spacesCount; i++) + for (int i = 1; i < spacesCount; i++) spacesItems[i] *= pathLength; } world = this.world.Resize(8).Items; @@ -303,7 +303,7 @@ namespace Spine { position *= pathLength / path.lengths[curveCount - 1]; if (percentSpacing) { - for (int i = 0; i < spacesCount; i++) + for (int i = 1; i < spacesCount; i++) spacesItems[i] *= pathLength; }