mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[c] Closes #2509, SP_INHERIT_NOSCALE was incorrectly implemented
This commit is contained in:
parent
39635f7566
commit
04c132f4af
@ -161,7 +161,12 @@ void spBone_updateWorldTransformWith(spBone *self, float x, float y, float rotat
|
||||
float za = (pa * cosine + pb * sine) / sx;
|
||||
float zc = (pc * cosine + pd * sine) / sy;
|
||||
float s = SQRT(za * za + zc * zc);
|
||||
if (self->data->inherit == SP_INHERIT_NOSCALE && (pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
|
||||
if (s > 0.00001f) s = 1 / s;
|
||||
za *= s;
|
||||
zc *= s;
|
||||
s = SQRT(za * za + zc * zc);
|
||||
if (self->inherit == SP_INHERIT_NOSCALE &&
|
||||
(pa * pd - pb * pc < 0) != (sx < 0 != sy < 0))
|
||||
s = -s;
|
||||
rotation = PI / 2 + ATAN2(zc, za);
|
||||
float zb = COS(rotation) * s;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user