Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

fix(annotations): robust blurIntensity normalization and initialization

Mahdy Ariefb5d74e906113
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index 7dcfa089..b845f670 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -2689,6 +2689,11 @@ export default function VideoEditor() {
if (!region.figureData) {
updatedRegion.figureData = { ...DEFAULT_FIGURE_DATA };
}
+ } else if (type === "blur") {
+ updatedRegion.content = "";
+ if (region.blurIntensity === undefined) {
+ updatedRegion.blurIntensity = 20;
+ }
}
return updatedRegion;
diff --git a/src/components/video-editor/projectPersistence.ts b/src/components/video-editor/projectPersistence.ts
index 699deefa..6b218402 100644
--- a/src/components/video-editor/projectPersistence.ts
+++ b/src/components/video-editor/projectPersistence.ts
@@ -446,7 +446,9 @@ export function normalizeProjectEditor(editor: Partial<ProjectEditorState>): Pro
...region.figureData,
}
: undefined,
- blurIntensity: isFiniteNumber(region.blurIntensity) ? region.blurIntensity : undefined,
+ blurIntensity: isFiniteNumber(region.blurIntensity)
+ ? clamp(region.blurIntensity, 1, 100)
+ : 20,
};
})
: [];