diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx index dda58035..bc12a142 100644 --- a/src/components/video-editor/SettingsPanel.tsx +++ b/src/components/video-editor/SettingsPanel.tsx @@ -211,7 +211,8 @@ export function SettingsPanel({ const [selectedColor, setSelectedColor] = useState('#ADADAD'); const [gradient, setGradient] = useState(GRADIENTS[0]); - const [showCropDropdown, setShowCropDropdown] = useState(false); + const [showCropModal, setShowCropModal] = useState(false); + const cropSnapshotRef = useRef(null); const zoomEnabled = Boolean(selectedZoomDepth); const trimEnabled = Boolean(selectedTrimId); @@ -228,6 +229,20 @@ export function SettingsPanel({ } }; + const handleCropToggle = () => { + if (!showCropModal && cropRegion) { + cropSnapshotRef.current = { ...cropRegion }; + } + setShowCropModal(!showCropModal); + }; + + const handleCropCancel = () => { + if (cropSnapshotRef.current && onCropChange) { + onCropChange(cropSnapshotRef.current); + } + setShowCropModal(false); + }; + const handleImageUpload = (event: React.ChangeEvent) => { const files = event.target.files; if (!files || files.length === 0) return; @@ -588,7 +603,7 @@ export function SettingsPanel({