mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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;
|
public var worldY : Number;
|
||||||
internal var _sorted : Boolean;
|
internal var _sorted : Boolean;
|
||||||
public var active : Boolean;
|
public var active : Boolean;
|
||||||
|
|
||||||
|
|
||||||
/** @param parent May be null. */
|
/** @param parent May be null. */
|
||||||
public function Bone(data : BoneData, skeleton : Skeleton, parent : Bone) {
|
public function Bone(data : BoneData, skeleton : Skeleton, parent : Bone) {
|
||||||
@ -68,7 +68,7 @@ package spine {
|
|||||||
_parent = parent;
|
_parent = parent;
|
||||||
setToSetupPose();
|
setToSetupPose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isActive() : Boolean {
|
public function isActive() : Boolean {
|
||||||
return active;
|
return active;
|
||||||
}
|
}
|
||||||
@ -102,8 +102,8 @@ package spine {
|
|||||||
|
|
||||||
var parent : Bone = _parent;
|
var parent : Bone = _parent;
|
||||||
if (!parent) { // Root bone.
|
if (!parent) { // Root bone.
|
||||||
rotationY = rotation + 90 + shearY;
|
rotationY = rotation + 90 + shearY;
|
||||||
var skeleton : Skeleton = _skeleton;
|
var skeleton : Skeleton = _skeleton;
|
||||||
this.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
|
this.a = MathUtils.cosDeg(rotation + shearX) * scaleX * sx;
|
||||||
this.b = MathUtils.cosDeg(rotationY) * scaleY * sx;
|
this.b = MathUtils.cosDeg(rotationY) * scaleY * sx;
|
||||||
this.c = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;
|
this.c = MathUtils.sinDeg(rotation + shearX) * scaleX * sy;
|
||||||
@ -161,7 +161,7 @@ package spine {
|
|||||||
this.b = pa * lb - pb * ld;
|
this.b = pa * lb - pb * ld;
|
||||||
this.c = pc * la + pd * lc;
|
this.c = pc * la + pd * lc;
|
||||||
this.d = pc * lb + pd * ld;
|
this.d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case TransformMode.noScale:
|
case TransformMode.noScale:
|
||||||
case TransformMode.noScaleOrReflection: {
|
case TransformMode.noScaleOrReflection: {
|
||||||
@ -182,11 +182,11 @@ package spine {
|
|||||||
la = MathUtils.cosDeg(shearX) * scaleX;
|
la = MathUtils.cosDeg(shearX) * scaleX;
|
||||||
lb = MathUtils.cosDeg(90 + shearY) * scaleY;
|
lb = MathUtils.cosDeg(90 + shearY) * scaleY;
|
||||||
lc = MathUtils.sinDeg(shearX) * scaleX;
|
lc = MathUtils.sinDeg(shearX) * scaleX;
|
||||||
ld = MathUtils.sinDeg(90 + shearY) * scaleY;
|
ld = MathUtils.sinDeg(90 + shearY) * scaleY;
|
||||||
this.a = za * la + zb * lc;
|
this.a = za * la + zb * lc;
|
||||||
this.b = za * lb + zb * ld;
|
this.b = za * lb + zb * ld;
|
||||||
this.c = zc * la + zd * lc;
|
this.c = zc * la + zd * lc;
|
||||||
this.d = zc * lb + zd * ld;
|
this.d = zc * lb + zd * ld;
|
||||||
break;
|
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->b) = pa * lb - pb * ld;
|
||||||
CONST_CAST(float, self->c) = pc * la + pd * lc;
|
CONST_CAST(float, self->c) = pc * la + pd * lc;
|
||||||
CONST_CAST(float, self->d) = pc * lb + pd * ld;
|
CONST_CAST(float, self->d) = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case SP_TRANSFORMMODE_NOSCALE:
|
case SP_TRANSFORMMODE_NOSCALE:
|
||||||
case SP_TRANSFORMMODE_NOSCALEORREFLECTION: {
|
case SP_TRANSFORMMODE_NOSCALEORREFLECTION: {
|
||||||
|
|||||||
@ -168,7 +168,7 @@ void Bone::updateWorldTransform(float x, float y, float rotation, float scaleX,
|
|||||||
_b = pa * lb - pb * ld;
|
_b = pa * lb - pb * ld;
|
||||||
_c = pc * la + pd * lc;
|
_c = pc * la + pd * lc;
|
||||||
_d = pc * lb + pd * ld;
|
_d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case TransformMode_NoScale:
|
case TransformMode_NoScale:
|
||||||
case TransformMode_NoScaleOrReflection: {
|
case TransformMode_NoScaleOrReflection: {
|
||||||
|
|||||||
@ -162,6 +162,7 @@ function Bone:updateWorldTransformWith (x, y, rotation, scaleX, scaleY, shearX,
|
|||||||
self.b = pa * lb - pb * ld
|
self.b = pa * lb - pb * ld
|
||||||
self.c = pc * la + pd * lc
|
self.c = pc * la + pd * lc
|
||||||
self.d = pc * lb + pd * ld
|
self.d = pc * lb + pd * ld
|
||||||
|
return
|
||||||
elseif transformMode == TransformMode.noScale or transformMode == TransformMode.noScaleOrReflection then
|
elseif transformMode == TransformMode.noScale or transformMode == TransformMode.noScaleOrReflection then
|
||||||
local cos = math_cos(math_rad(rotation))
|
local cos = math_cos(math_rad(rotation))
|
||||||
local sin = math_sin(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.b = pa * lb - pb * ld;
|
||||||
this.c = pc * la + pd * lc;
|
this.c = pc * la + pd * lc;
|
||||||
this.d = pc * lb + pd * ld;
|
this.d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case spine.TransformMode.NoScale:
|
case spine.TransformMode.NoScale:
|
||||||
case spine.TransformMode.NoScaleOrReflection: {
|
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.b = pa * lb - pb * ld;
|
||||||
this.c = pc * la + pd * lc;
|
this.c = pc * la + pd * lc;
|
||||||
this.d = pc * lb + pd * ld;
|
this.d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case spine.TransformMode.NoScale:
|
case spine.TransformMode.NoScale:
|
||||||
case spine.TransformMode.NoScaleOrReflection: {
|
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.b = pa * lb - pb * ld;
|
||||||
this.c = pc * la + pd * lc;
|
this.c = pc * la + pd * lc;
|
||||||
this.d = pc * lb + pd * ld;
|
this.d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case spine.TransformMode.NoScale:
|
case spine.TransformMode.NoScale:
|
||||||
case spine.TransformMode.NoScaleOrReflection: {
|
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.b = pa * lb - pb * ld;
|
||||||
this.c = pc * la + pd * lc;
|
this.c = pc * la + pd * lc;
|
||||||
this.d = pc * lb + pd * ld;
|
this.d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case spine.TransformMode.NoScale:
|
case spine.TransformMode.NoScale:
|
||||||
case spine.TransformMode.NoScaleOrReflection: {
|
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.b = pa * lb - pb * ld;
|
||||||
this.c = pc * la + pd * lc;
|
this.c = pc * la + pd * lc;
|
||||||
this.d = pc * lb + pd * ld;
|
this.d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case spine.TransformMode.NoScale:
|
case spine.TransformMode.NoScale:
|
||||||
case spine.TransformMode.NoScaleOrReflection: {
|
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.b = pa * lb - pb * ld;
|
||||||
this.c = pc * la + pd * lc;
|
this.c = pc * la + pd * lc;
|
||||||
this.d = pc * lb + pd * ld;
|
this.d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case spine.TransformMode.NoScale:
|
case spine.TransformMode.NoScale:
|
||||||
case spine.TransformMode.NoScaleOrReflection: {
|
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.b = pa * lb - pb * ld;
|
||||||
this.c = pc * la + pd * lc;
|
this.c = pc * la + pd * lc;
|
||||||
this.d = pc * lb + pd * ld;
|
this.d = pc * lb + pd * ld;
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
case TransformMode.NoScale:
|
case TransformMode.NoScale:
|
||||||
case TransformMode.NoScaleOrReflection: {
|
case TransformMode.NoScaleOrReflection: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user