diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index 71f320b..c9f62c8 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -603,11 +603,14 @@ // temp fix for if the element is in a non visible var worldTransform = item.worldTransform, i, - a00 = worldTransform.a, a01 = worldTransform.b, a02 = worldTransform.tx, - a10 = worldTransform.c, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10), - x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, - y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + a = worldTransform.a, b = worldTransform.b, + c = worldTransform.c, tx = worldTransform.tx, + d = worldTransform.d, ty = worldTransform.ty, + + id = 1 / (a * d + c * -b), + x = d * id * global.x + -c * id * global.y + (ty * c - tx * d) * id, + y = a * id * global.y + -b * id * global.x + (-ty * a + tx * b) * id; + interactionData.target = item; diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index 71f320b..c9f62c8 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -603,11 +603,14 @@ // temp fix for if the element is in a non visible var worldTransform = item.worldTransform, i, - a00 = worldTransform.a, a01 = worldTransform.b, a02 = worldTransform.tx, - a10 = worldTransform.c, a11 = worldTransform.d, a12 = worldTransform.ty, - id = 1 / (a00 * a11 + a01 * -a10), - x = a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id, - y = a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id; + a = worldTransform.a, b = worldTransform.b, + c = worldTransform.c, tx = worldTransform.tx, + d = worldTransform.d, ty = worldTransform.ty, + + id = 1 / (a * d + c * -b), + x = d * id * global.x + -c * id * global.y + (ty * c - tx * d) * id, + y = a * id * global.y + -b * id * global.x + (-ty * a + tx * b) * id; + interactionData.target = item; diff --git a/src/pixi/geom/Matrix.js b/src/pixi/geom/Matrix.js index e12d0e8..cd476b2 100644 --- a/src/pixi/geom/Matrix.js +++ b/src/pixi/geom/Matrix.js @@ -152,9 +152,10 @@ { newPos = newPos || new PIXI.Point(); - var id = 1 / (this.a * this.d + this.b * -this.c); - newPos.x = this.d * id * pos.x - this.b * id * pos.y + (this.ty * this.b - this.tx * this.d) * id; - newPos.y = this.a * id * pos.y - this.c * id * pos.x + (this.tx * this.c - this.ty * this.a) * id; + var id = 1 / (this.a * this.d + this.c * -this.b); + + newPos.x = this.d * id * pos.x + -this.c * id * pos.y + (this.ty * this.c - this.tx * this.d) * id; + newPos.y = this.a * id * pos.y + -this.b * id * pos.x + (-this.ty * this.a + this.tx * this.b) * id; return newPos; };