Merge pull request #6819 from moufmouf/fix-dom-zoom-origin

Fixing DomElement position when camera zoom != 1
This commit is contained in:
Richard Davey 2024-09-03 14:36:59 +01:00 committed by GitHub
commit 25f20485a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)