Skip to content

Commit 57ff6f4

Browse files
committed
Fixed applyInverse point cache bug.
1 parent 1229c79 commit 57ff6f4

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/pixi/geom/Matrix.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ PIXI.Matrix.prototype.applyInverse = function(pos, newPos)
153153
newPos = newPos || new PIXI.Point();
154154

155155
var id = 1 / (this.a * this.d + this.c * -this.b);
156-
157-
newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id;
158-
newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id;
156+
var x = pos.x;
157+
var y = pos.y;
158+
159+
newPos.x = this.d * id * x + -this.c * id * y + (this.ty * this.c - this.tx * this.d) * id;
160+
newPos.y = this.a * id * y + -this.b * id * x + (-this.ty * this.a + this.tx * this.b) * id;
159161

160162
return newPos;
161163
};

0 commit comments

Comments
 (0)