fix: png-exporting does not preserve angles correctly for flipped images (#6085)

* fix: png-exporting does not preserve angles correctly for flipped images

* refactor related code

* simplify further and comment
This commit is contained in:
David Luzar 2023-01-08 16:22:04 +01:00 committed by GitHub
parent 40d53d9231
commit 809d5ba17f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 28 deletions

View file

@ -41,8 +41,8 @@ export const centerScrollOn = ({
zoom: Zoom;
}) => {
return {
scrollX: (viewportDimensions.width / 2) * (1 / zoom.value) - scenePoint.x,
scrollY: (viewportDimensions.height / 2) * (1 / zoom.value) - scenePoint.y,
scrollX: viewportDimensions.width / 2 / zoom.value - scenePoint.x,
scrollY: viewportDimensions.height / 2 / zoom.value - scenePoint.y,
};
};