mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
Merge pull request #6819 from moufmouf/fix-dom-zoom-origin
Fixing DomElement position when camera zoom != 1
This commit is contained in:
commit
25f20485a2
1 changed files with 4 additions and 1 deletions
|
@ -85,7 +85,7 @@ var DOMElementCSSRenderer = function (renderer, src, camera, parentMatrix)
|
||||||
dx = (src.width) * src.originX;
|
dx = (src.width) * src.originX;
|
||||||
dy = (src.height) * src.originY;
|
dy = (src.height) * src.originY;
|
||||||
|
|
||||||
srcMatrix.applyITRS(src.x - dx, src.y - dy, src.rotation, src.scaleX, src.scaleY);
|
srcMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);
|
||||||
|
|
||||||
camMatrix.copyFrom(camera.matrix);
|
camMatrix.copyFrom(camera.matrix);
|
||||||
|
|
||||||
|
@ -97,6 +97,9 @@ var DOMElementCSSRenderer = function (renderer, src, camera, parentMatrix)
|
||||||
|
|
||||||
// Multiply by the src matrix, store result in calcMatrix
|
// Multiply by the src matrix, store result in calcMatrix
|
||||||
camMatrix.multiply(srcMatrix, calcMatrix);
|
camMatrix.multiply(srcMatrix, calcMatrix);
|
||||||
|
|
||||||
|
calcMatrix.e -= dx;
|
||||||
|
calcMatrix.f -= dy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!src.transformOnly)
|
if (!src.transformOnly)
|
||||||
|
|
Loading…
Reference in a new issue