Jelajahi Sumber

[lua] Fix path constraint for when path length is NaN. See #1230.

badlogic 6 tahun lalu
induk
melakukan
7d066d7f9d
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      spine-lua/PathConstraint.lua

+ 2 - 2
spine-lua/PathConstraint.lua

@@ -252,7 +252,7 @@ function PathConstraint:computeWorldPositions (path, spacesCount, tangents, perc
 		local pathLength = lengths[curveCount + 1];
 		local pathLength = lengths[curveCount + 1];
 		if percentPosition then position = position * pathLength end
 		if percentPosition then position = position * pathLength end
 		if percentSpacing then
 		if percentSpacing then
-			i = 0
+			i = 1
 			while i < spacesCount do
 			while i < spacesCount do
 				spaces[i + 1] = spaces[i + 1] * pathLength
 				spaces[i + 1] = spaces[i + 1] * pathLength
 				i = i + 1
 				i = i + 1
@@ -395,7 +395,7 @@ function PathConstraint:computeWorldPositions (path, spacesCount, tangents, perc
 		position = position * pathLength / path.lengths[curveCount];
 		position = position * pathLength / path.lengths[curveCount];
 	end
 	end
 	if percentSpacing then
 	if percentSpacing then
-		i = 0
+		i = 1
 		while i < spacesCount do
 		while i < spacesCount do
 			spaces[i + 1] = spaces[i + 1] * pathLength
 			spaces[i + 1] = spaces[i + 1] * pathLength
 			i = i + 1
 			i = i + 1