浏览代码

[csharp] Fix PathConstraint spacing.

John 8 年之前
父节点
当前提交
4b2fb3eedf
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      spine-csharp/src/PathConstraint.cs

+ 3 - 2
spine-csharp/src/PathConstraint.cs

@@ -66,6 +66,7 @@ namespace Spine {
 			translateMix = data.translateMix;
 		}
 
+		/// <summary>Applies the constraint to the constrained bones.</summary>
 		public void Apply () {
 			Update();
 		}
@@ -95,8 +96,8 @@ namespace Spine {
 					if (setupLength == 0) setupLength = 0.000000001f;
 					float x = setupLength * bone.a, y = setupLength * bone.c;
 					float length = (float)Math.Sqrt(x * x + y * y);
-					if (scale) lengths.Items[i] = setupLength;
-					spaces.Items[++i] = (lengthSpacing ? Math.Max(0, setupLength + spacing) : spacing) * length / setupLength;
+					if (scale) lengths.Items[i] = length;
+					spaces.Items[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength;
 				}
 			} else {
 				for (int i = 1; i < spacesCount; i++)