Skip to content

Commit 8b5c66b

Browse files
committed
[ts] Port of commit 508e501: Don't wrap angles for transform constraint absolute local.
1 parent 508e501 commit 8b5c66b

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

spine-ts/spine-core/src/TransformConstraint.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,7 @@ export class TransformConstraint implements Updatable {
248248
let bone = bones[i];
249249

250250
let rotation = bone.arotation;
251-
if (mixRotate != 0) {
252-
let r = target.arotation - rotation + this.data.offsetRotation;
253-
r -= Math.ceil(r / 360 - 0.5) * 360;
254-
rotation += r * mixRotate;
255-
}
251+
if (mixRotate != 0) rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate;
256252

257253
let x = bone.ax, y = bone.ay;
258254
x += (target.ax - x + this.data.offsetX) * mixX;
@@ -265,11 +261,7 @@ export class TransformConstraint implements Updatable {
265261
scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;
266262

267263
let shearY = bone.ashearY;
268-
if (mixShearY != 0) {
269-
let r = target.ashearY - shearY + this.data.offsetShearY;
270-
r -= Math.ceil(r / 360 - 0.5) * 360;
271-
shearY += r * mixShearY;
272-
}
264+
if (mixShearY != 0) shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY;
273265

274266
bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);
275267
}

0 commit comments

Comments
 (0)