mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 16:48:43 +08:00
[c][cpp] Ported fix for #1224, disable inherit scale.
This commit is contained in:
parent
de543b2cfc
commit
86334f50ff
@ -154,6 +154,8 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
|
||||
za *= s;
|
||||
zc *= s;
|
||||
s = SQRT(za * za + zc * zc);
|
||||
if (self->data->transformMode == SP_TRANSFORMMODE_NOSCALE && (pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
|
||||
s = -s;
|
||||
r = PI / 2 + ATAN2(zc, za);
|
||||
zb = COS(r) * s;
|
||||
zd = SIN(r) * s;
|
||||
|
||||
@ -183,6 +183,9 @@ Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float
|
||||
za *= s;
|
||||
zc *= s;
|
||||
s = MathUtil::sqrt(za * za + zc * zc);
|
||||
if (_data.getTransformMode() == TransformMode_NoScale
|
||||
&& (pa * pd - pb * pc < 0) != (_skeleton.getScaleX() < 0 != _skeleton.getScaleY() < 0))
|
||||
s = -s;
|
||||
r = MathUtil::Pi / 2 + MathUtil::atan2(zc, za);
|
||||
zb = MathUtil::cos(r) * s;
|
||||
zd = MathUtil::sin(r) * s;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user