mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-10 09:08:42 +08:00
[runtimes] Port of fix for TransformMode.noRotationOrReflection applying skeleton scale twice. See #1668.
This commit is contained in:
parent
c73f8c1f42
commit
6a317a1e3f
Binary file not shown.
@ -57,7 +57,7 @@ package spine {
|
||||
public var worldY : Number;
|
||||
internal var _sorted : Boolean;
|
||||
public var active : Boolean;
|
||||
|
||||
|
||||
|
||||
/** @param parent May be null. */
|
||||
public function Bone(data : BoneData, skeleton : Skeleton, parent : Bone) {
|
||||
@ -68,7 +68,7 @@ package spine {
|
||||
_parent = parent;
|
||||
setToSetupPose();
|
||||
}
|
||||
|
||||
|
||||
public function isActive() : Boolean {
|
||||
return active;
|
||||
}
|
||||
@ -102,8 +102,8 @@ package spine {
|
||||
|
||||
var parent : Bone = _parent;
|
||||
if (!parent) { // Root bone.
|
||||
rotationY = rotation + 90 + shearY;
|
||||
var skeleton : Skeleton = _skeleton;
|
||||
rotationY = rotation + 90 + shearY;
|
||||
var skeleton : Skeleton = _skeleton;
|
||||
this.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
|
||||
this.b = MathUtils.cosDeg(rotationY) * scaleY * sx;
|
||||
this.c = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;
|
||||
@ -161,7 +161,7 @@ package spine {
|
||||
this.b = pa * lb - pb * ld;
|
||||
this.c = pc * la + pd * lc;
|
||||
this.d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case TransformMode.noScale:
|
||||
case TransformMode.noScaleOrReflection: {
|
||||
@ -182,11 +182,11 @@ package spine {
|
||||
la = MathUtils.cosDeg(shearX) * scaleX;
|
||||
lb = MathUtils.cosDeg(90 + shearY) * scaleY;
|
||||
lc = MathUtils.sinDeg(shearX) * scaleX;
|
||||
ld = MathUtils.sinDeg(90 + shearY) * scaleY;
|
||||
ld = MathUtils.sinDeg(90 + shearY) * scaleY;
|
||||
this.a = za * la + zb * lc;
|
||||
this.b = za * lb + zb * ld;
|
||||
this.c = zc * la + zd * lc;
|
||||
this.d = zc * lb + zd * ld;
|
||||
this.d = zc * lb + zd * ld;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
|
||||
CONST_CAST(float, self->b) = pa * lb - pb * ld;
|
||||
CONST_CAST(float, self->c) = pc * la + pd * lc;
|
||||
CONST_CAST(float, self->d) = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case SP_TRANSFORMMODE_NOSCALE:
|
||||
case SP_TRANSFORMMODE_NOSCALEORREFLECTION: {
|
||||
|
||||
@ -168,7 +168,7 @@ void Bone::updateWorldTransform(float x, float y, float rotation, float scaleX,
|
||||
_b = pa * lb - pb * ld;
|
||||
_c = pc * la + pd * lc;
|
||||
_d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case TransformMode_NoScale:
|
||||
case TransformMode_NoScaleOrReflection: {
|
||||
|
||||
@ -162,6 +162,7 @@ function Bone:updateWorldTransformWith (x, y, rotation, scaleX, scaleY, shearX,
|
||||
self.b = pa * lb - pb * ld
|
||||
self.c = pc * la + pd * lc
|
||||
self.d = pc * lb + pd * ld
|
||||
return
|
||||
elseif transformMode == TransformMode.noScale or transformMode == TransformMode.noScaleOrReflection then
|
||||
local cos = math_cos(math_rad(rotation))
|
||||
local sin = math_sin(math_rad(rotation))
|
||||
|
||||
Binary file not shown.
@ -2583,7 +2583,7 @@ var spine;
|
||||
this.b = pa * lb - pb * ld;
|
||||
this.c = pc * la + pd * lc;
|
||||
this.d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case spine.TransformMode.NoScale:
|
||||
case spine.TransformMode.NoScaleOrReflection: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -2583,7 +2583,7 @@ var spine;
|
||||
this.b = pa * lb - pb * ld;
|
||||
this.c = pc * la + pd * lc;
|
||||
this.d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case spine.TransformMode.NoScale:
|
||||
case spine.TransformMode.NoScaleOrReflection: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -2583,7 +2583,7 @@ var spine;
|
||||
this.b = pa * lb - pb * ld;
|
||||
this.c = pc * la + pd * lc;
|
||||
this.d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case spine.TransformMode.NoScale:
|
||||
case spine.TransformMode.NoScaleOrReflection: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -2583,7 +2583,7 @@ var spine;
|
||||
this.b = pa * lb - pb * ld;
|
||||
this.c = pc * la + pd * lc;
|
||||
this.d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case spine.TransformMode.NoScale:
|
||||
case spine.TransformMode.NoScaleOrReflection: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -2583,7 +2583,7 @@ var spine;
|
||||
this.b = pa * lb - pb * ld;
|
||||
this.c = pc * la + pd * lc;
|
||||
this.d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case spine.TransformMode.NoScale:
|
||||
case spine.TransformMode.NoScaleOrReflection: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -2583,7 +2583,7 @@ var spine;
|
||||
this.b = pa * lb - pb * ld;
|
||||
this.c = pc * la + pd * lc;
|
||||
this.d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case spine.TransformMode.NoScale:
|
||||
case spine.TransformMode.NoScaleOrReflection: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -219,7 +219,7 @@ module spine {
|
||||
this.b = pa * lb - pb * ld;
|
||||
this.c = pc * la + pd * lc;
|
||||
this.d = pc * lb + pd * ld;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case TransformMode.NoScale:
|
||||
case TransformMode.NoScaleOrReflection: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user