From 38d72217c22500c2c6fd8924aa2dd5b4bb71cb28 Mon Sep 17 00:00:00 2001 From: LorenzoLancia Date: Wed, 8 Apr 2026 22:43:30 +0200 Subject: [PATCH] fix little things blur --- src/components/video-editor/VideoEditor.tsx | 17 +++++++++++++---- src/components/video-editor/timeline/Item.tsx | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx index c162730..ffe3add 100644 --- a/src/components/video-editor/VideoEditor.tsx +++ b/src/components/video-editor/VideoEditor.tsx @@ -1028,8 +1028,17 @@ export default function VideoEditor() { return updatedRegion; }), })); + + if (type === "blur" && selectedAnnotationId === id) { + setSelectedAnnotationId(null); + setSelectedBlurId(id); + setSelectedSpeedId(null); + } else if (type !== "blur" && selectedBlurId === id) { + setSelectedBlurId(null); + setSelectedAnnotationId(id); + } }, - [pushState], + [pushState, selectedAnnotationId, selectedBlurId], ); const handleAnnotationStyleChange = useCallback( @@ -1212,14 +1221,14 @@ export default function VideoEditor() { useEffect(() => { if ( selectedAnnotationId && - !annotationRegions.some((region) => region.id === selectedAnnotationId) + !annotationOnlyRegions.some((region) => region.id === selectedAnnotationId) ) { setSelectedAnnotationId(null); } - if (selectedBlurId && !annotationRegions.some((region) => region.id === selectedBlurId)) { + if (selectedBlurId && !blurRegions.some((region) => region.id === selectedBlurId)) { setSelectedBlurId(null); } - }, [selectedAnnotationId, selectedBlurId, annotationRegions]); + }, [selectedAnnotationId, selectedBlurId, annotationOnlyRegions, blurRegions]); useEffect(() => { if (selectedSpeedId && !speedRegions.some((region) => region.id === selectedSpeedId)) { diff --git a/src/components/video-editor/timeline/Item.tsx b/src/components/video-editor/timeline/Item.tsx index f265fe4..d2d0298 100644 --- a/src/components/video-editor/timeline/Item.tsx +++ b/src/components/video-editor/timeline/Item.tsx @@ -14,7 +14,7 @@ interface ItemProps { onSelect?: () => void; zoomDepth?: number; speedValue?: number; - variant?: "zoom" | "trim" | "annotation" | "speed"; + variant?: "zoom" | "trim" | "annotation" | "speed" | "blur"; } // Map zoom depth to multiplier labels