From 8b5c66b8f80ae2d0a4d8f13d51d148e88501bd16 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Tue, 2 Apr 2024 09:33:02 +0200 Subject: [PATCH] [ts] Port of commit 508e501: Don't wrap angles for transform constraint absolute local. --- spine-ts/spine-core/src/TransformConstraint.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/spine-ts/spine-core/src/TransformConstraint.ts b/spine-ts/spine-core/src/TransformConstraint.ts index 649b85fe7..040b0213f 100644 --- a/spine-ts/spine-core/src/TransformConstraint.ts +++ b/spine-ts/spine-core/src/TransformConstraint.ts @@ -248,11 +248,7 @@ export class TransformConstraint implements Updatable { let bone = bones[i]; let rotation = bone.arotation; - if (mixRotate != 0) { - let r = target.arotation - rotation + this.data.offsetRotation; - r -= Math.ceil(r / 360 - 0.5) * 360; - rotation += r * mixRotate; - } + if (mixRotate != 0) rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate; let x = bone.ax, y = bone.ay; x += (target.ax - x + this.data.offsetX) * mixX; @@ -265,11 +261,7 @@ export class TransformConstraint implements Updatable { scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY; let shearY = bone.ashearY; - if (mixShearY != 0) { - let r = target.ashearY - shearY + this.data.offsetShearY; - r -= Math.ceil(r / 360 - 0.5) * 360; - shearY += r * mixShearY; - } + if (mixShearY != 0) shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY; bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); }