mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
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:
parent
40d53d9231
commit
809d5ba17f
3 changed files with 31 additions and 28 deletions
|
@ -352,9 +352,8 @@ export const viewportCoordsToSceneCoords = (
|
|||
scrollY: number;
|
||||
},
|
||||
) => {
|
||||
const invScale = 1 / zoom.value;
|
||||
const x = (clientX - offsetLeft) * invScale - scrollX;
|
||||
const y = (clientY - offsetTop) * invScale - scrollY;
|
||||
const x = (clientX - offsetLeft) / zoom.value - scrollX;
|
||||
const y = (clientY - offsetTop) / zoom.value - scrollY;
|
||||
|
||||
return { x, y };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue