fix: proportions when rotating

This commit is contained in:
httpjamesm 2023-10-15 12:29:23 -04:00
parent fe057bdff8
commit d951c6e777
No known key found for this signature in database

View file

@ -308,8 +308,15 @@ const ImageEditorOverlay = (props: IProps) => {
image.onload = () => { image.onload = () => {
// reset the canvas with new dimensions // reset the canvas with new dimensions
canvas.width = image.width; if (angle % 180 === 0) {
canvas.height = image.height; canvas.width = image.width;
canvas.height = image.height;
} else {
canvas.width = image.height;
canvas.height = image.width;
}
// canvas.width = image.width;
// canvas.height = image.height;
// canvas.width = scaledHeight; // canvas.width = scaledHeight;
// canvas.height = scaledWidth; // canvas.height = scaledWidth;
// cw = canvas.width; // cw = canvas.width;