From 006242458919c54db6a1b7c922b48ad056a1444e Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 13 Dec 2018 09:50:13 +0100 Subject: [PATCH] Allow transform constraint scale and shearY mix < 0. #1227 --- .../esotericsoftware/spine/TransformConstraint.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java index 62bad7d0b..5376f9288 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/TransformConstraint.java @@ -242,16 +242,16 @@ public class TransformConstraint implements Constraint { } float scaleX = bone.ascaleX, scaleY = bone.ascaleY; - if (scaleMix > 0) { + if (scaleMix != 0) { if (scaleX != 0) scaleX = (scaleX + (target.ascaleX - scaleX + data.offsetScaleX) * scaleMix) / scaleX; if (scaleY != 0) scaleY = (scaleY + (target.ascaleY - scaleY + data.offsetScaleY) * scaleMix) / scaleY; } float shearY = bone.ashearY; - if (shearMix > 0) { + if (shearMix != 0) { float r = target.ashearY - shearY + data.offsetShearY; r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360; - bone.shearY += r * shearMix; + shearY += r * shearMix; } bone.updateWorldTransform(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); @@ -277,13 +277,13 @@ public class TransformConstraint implements Constraint { } float scaleX = bone.ascaleX, scaleY = bone.ascaleY; - if (scaleMix > 0) { + if (scaleMix != 0) { scaleX *= ((target.ascaleX - 1 + data.offsetScaleX) * scaleMix) + 1; scaleY *= ((target.ascaleY - 1 + data.offsetScaleY) * scaleMix) + 1; } float shearY = bone.ashearY; - if (shearMix > 0) shearY += (target.ashearY + data.offsetShearY) * shearMix; + if (shearMix != 0) shearY += (target.ashearY + data.offsetShearY) * shearMix; bone.updateWorldTransform(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); }