Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

feat: force aspect ratio resizing

httpjamesmb9a716e318e2
diff --git a/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
index a775127050..ba8bfa9beb 100644
--- a/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
+++ b/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
@@ -213,6 +213,10 @@ const ImageEditorOverlay = (props: IProps) => {
if (newWidth <= 0) newWidth = 1;
if (newHeight <= 0) newHeight = 1;
+ // Calculate new height based on aspect ratio
+ const aspectRatio = originalCanvasWidth / originalCanvasHeight;
+ newHeight = newWidth / aspectRatio;
+
const newTop = canvasTop;
const newLeft = canvasLeft;