Browse Source

[ts] Port: Scale physics constraint limits with skeleton scale. See #2576.

Davide Tantillo 1 year ago
parent
commit
520c0750f5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      spine-ts/spine-core/src/PhysicsConstraint.ts

+ 2 - 2
spine-ts/spine-core/src/PhysicsConstraint.ts

@@ -148,8 +148,8 @@ export class PhysicsConstraint implements Updatable {
 					this.uy = by;
 				} else {
 					let a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;
-					let qx = this.data.limit * delta, qy = qx * skeleton.scaleY;
-					qx *= skeleton.scaleX;
+					let qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY);
+					qx *= Math.abs(skeleton.scaleX);
 					if (x || y) {
 						if (x) {
 							const u = (this.ux - bx) * i;