mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-20 00:36:43 +08:00
[as3][c][cpp][cs][libgdx][lua] Fixed crash with path constraint proportional spacing and tangent rotate modes.
This commit is contained in:
parent
109356268f
commit
87b9821e00
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user