diff --git a/lama_cleaner/app/src/App.tsx b/lama_cleaner/app/src/App.tsx
index 7fd03c1..493ce84 100644
--- a/lama_cleaner/app/src/App.tsx
+++ b/lama_cleaner/app/src/App.tsx
@@ -11,7 +11,7 @@ function App() {
return (
-
+
{file ? (
}
@@ -29,9 +29,7 @@ function App() {
{file ? (
diff --git a/lama_cleaner/app/src/Editor.tsx b/lama_cleaner/app/src/Editor.tsx
index af8e088..aa26632 100644
--- a/lama_cleaner/app/src/Editor.tsx
+++ b/lama_cleaner/app/src/Editor.tsx
@@ -11,7 +11,12 @@ import {
TransformComponent,
TransformWrapper,
} from 'react-zoom-pan-pinch'
-import { useWindowSize, useLocalStorage, useKey } from 'react-use'
+import {
+ useWindowSize,
+ useLocalStorage,
+ useKey,
+ useKeyPressEvent,
+} from 'react-use'
import inpaint from './adapters/inpainting'
import Button from './components/Button'
import Slider from './components/Slider'
@@ -211,7 +216,10 @@ export default function Editor(props: EditorProps) {
const offsetX = (windowSize.width - original.width * minScale) / 2
const offsetY = (windowSize.height - original.height * minScale) / 2
viewport.setTransform(offsetX, offsetY, minScale, 200, 'easeOutQuad')
- }, [minScale, original, windowSize, isOriginalLoaded])
+ setScale(minScale)
+ }, [minScale, original, windowSize])
+
+ useKeyPressEvent('Escape', resetZoom)
const onPaint = (px: number, py: number) => {
const currShowLine = lines4Show[lines4Show.length - 1]
@@ -343,7 +351,6 @@ export default function Editor(props: EditorProps) {