Explorar o código

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

Davide Tantillo hai 1 ano
pai
achega
520c0750f5
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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;
 					this.uy = by;
 				} else {
 				} else {
 					let a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;
 					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 || y) {
 						if (x) {
 						if (x) {
 							const u = (this.ux - bx) * i;
 							const u = (this.ux - bx) * i;