[as3][c][cpp][cs][libgdx][lua] Fixed crash with path constraint proportional spacing and tangent rotate modes.

This commit is contained in:
Nathan Sweet 2021-06-30 14:11:14 -04:00
parent 109356268f
commit 87b9821e00
7 changed files with 10 additions and 9 deletions

View File

@ -108,7 +108,7 @@ package spine {
break;
case SpacingMode.proportional:
var sum : Number = 0;
for (i = 0; i < boneCount;) {
for (i = 0, n = spacesCount - 1; i < n;) {
bone = bones[i];
setupLength = bone.data.length;
if (setupLength < PathConstraint.epsilon) {

View File

@ -126,11 +126,12 @@ void spPathConstraint_update(spPathConstraint *self) {
}
}
}
for (i = 1, n = spacesCount; i < n; i++) spaces[i] = spacing;
for (i = 1, n = spacesCount; i < n; i++)
spaces[i] = spacing;
break;
case SP_SPACING_MODE_PROPORTIONAL:
sum = 0;
for (i = 0; i < boneCount;) {
for (i = 0, n = spacesCount - 1; i < n;) {
spBone *bone = bones[i];
setupLength = bone->data->length;
if (setupLength < EPSILON) {

View File

@ -110,7 +110,7 @@ void PathConstraint::update() {
}
case SpacingMode_Proportional: {
float sum = 0;
for (size_t i = 0; i < boneCount;) {
for (size_t i = 0, n = spacesCount - 1; i < n;) {
Bone *boneP = _bones[i];
Bone &bone = *boneP;
float setupLength = bone._data.getLength();

View File

@ -120,7 +120,7 @@ namespace Spine {
break;
case SpacingMode.Proportional: {
float sum = 0;
for (int i = 0; i < boneCount;) {
for (int i = 0, n = spacesCount - 1; i < n;) {
Bone bone = bonesItems[i];
float setupLength = bone.data.length;
if (setupLength < PathConstraint.Epsilon) {
@ -143,7 +143,6 @@ namespace Spine {
}
default: {
bool lengthSpacing = data.spacingMode == SpacingMode.Length;
for (int i = 0, n = spacesCount - 1; i < n;) {
Bone bone = bonesItems[i];
float setupLength = bone.data.length;

View File

@ -124,7 +124,7 @@ public class PathConstraint implements Updatable {
break;
case proportional:
float sum = 0;
for (int i = 0; i < boneCount;) {
for (int i = 0, n = spacesCount - 1; i < n;) {
Bone bone = (Bone)bones[i];
float setupLength = bone.data.length;
if (setupLength < epsilon) {

View File

@ -137,7 +137,8 @@ function PathConstraint:update ()
elseif data.spacingMode == PathConstraintData.SpacingMode.proportional then
local sum = 0
local i = 0
while i < boneCount do
local n = spacesCount - 1
while i < n do
local bone = bones[i + 1]
local setupLength = bone.data.length
if setupLength < epsilon then

View File

@ -116,7 +116,7 @@ module spine {
break;
case SpacingMode.Proportional:
let sum = 0;
for (let i = 0; i < boneCount;) {
for (let i = 0, n = spacesCount - 1; i < n;) {
let bone = bones[i];
let setupLength = bone.data.length;
if (setupLength < PathConstraint.epsilon) {