Skip to content

armgit / ente

Public Imported from GitHub
0

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

feat: reset crop box after successful crop

httpjamesm176993216e0d
diff --git a/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/CropMenu.tsx b/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/CropMenu.tsx
index 0f63e83ce5..625e807448 100644
--- a/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/CropMenu.tsx
+++ b/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/CropMenu.tsx
@@ -12,6 +12,7 @@ interface IProps {
previewScale: number;
cropBoxProps: CropBoxProps;
cropBoxRef: MutableRefObject<HTMLDivElement>;
+ resetCropBox: () => void;
}
const CropMenu = (props: IProps) => {
@@ -59,6 +60,8 @@ const CropMenu = (props: IProps) => {
width,
height
);
+
+ props.resetCropBox();
};
};
diff --git a/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
index 95e9b57193..6d4ffbe305 100644
--- a/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
+++ b/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx
@@ -788,6 +788,7 @@ const ImageEditorOverlay = (props: IProps) => {
previewScale={previewCanvasScale}
cropBoxProps={cropBox}
cropBoxRef={cropBoxRef}
+ resetCropBox={resetCropBox}
/>
)}
{currentTab === 'transform' && <TransformMenu />}