Skip to content

Commit

Permalink
[c] Fix applying flipping for noScale/noScaleOrReflection transform m…
Browse files Browse the repository at this point in the history
…ode. See #951
  • Loading branch information
badlogic committed Jul 19, 2017
1 parent 20cdb9e commit 1013e31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spine-c/spine-c/src/spine/Bone.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ void spBone_updateWorldTransformWith (spBone* self, float x, float y, float rota
lb = COS_DEG(90 + shearY) * scaleY;
lc = SIN_DEG(shearX) * scaleX;
ld = SIN_DEG(90 + shearY) * scaleY;
if (self->data->transformMode != SP_TRANSFORMMODE_NOSCALEORREFLECTION ? pa * pd - pb * pc < 0 : self->skeleton->flipX != self->skeleton->flipY) {
zb = -zb;
zd = -zd;
}
CONST_CAST(float, self->a) = za * la + zb * lc;
CONST_CAST(float, self->b) = za * lb + zb * ld;
CONST_CAST(float, self->c) = zc * la + zd * lc;
CONST_CAST(float, self->d) = zc * lb + zd * ld;
if (self->data->transformMode != SP_TRANSFORMMODE_NOSCALEORREFLECTION ? pa * pd - pb * pc < 0 : self->skeleton->flipX != self->skeleton->flipY) {
CONST_CAST(float, self->b) = -self->b;
CONST_CAST(float, self->d) = -self->d;
}
return;
}
}
Expand Down

0 comments on commit 1013e31

Please sign in to comment.