[csharp] Closes #1228.

This commit is contained in:
badlogic 2018-12-13 18:11:18 +01:00
parent 90f3823c15
commit 91a1dc4ece

View File

@ -183,11 +183,12 @@ namespace Spine {
float[] spacesItems = this.spaces.Items, output = this.positions.Resize(spacesCount * 3 + 2).Items, world;
bool closed = path.Closed;
int verticesLength = path.WorldVerticesLength, curveCount = verticesLength / 6, prevCurve = NONE;
float pathLength = 0;
if (!path.ConstantSpeed) {
float[] lengths = path.Lengths;
curveCount -= closed ? 1 : 2;
float pathLength = lengths[curveCount];
pathLength = lengths[curveCount];
if (percentPosition) position *= pathLength;
if (percentSpacing) {
for (int i = 0; i < spacesCount; i++)
@ -262,7 +263,7 @@ namespace Spine {
// Curve lengths.
float[] curves = this.curves.Resize(curveCount).Items;
float pathLength = 0;
pathLength = 0;
float x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;
float tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy;
for (int i = 0, w = 2; i < curveCount; i++, w += 6) {