Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix: avoid history checkpoint spam on motion blur drag

Etienne Lescot446e3a35fc0c
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index 92ddec4aa..ec589ab2c 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -94,6 +94,7 @@ interface SettingsPanelProps {
onBlurChange?: (showBlur: boolean) => void;
motionBlurAmount?: number;
onMotionBlurChange?: (amount: number) => void;
+ onMotionBlurCommit?: () => void;
borderRadius?: number;
onBorderRadiusChange?: (radius: number) => void;
onBorderRadiusCommit?: () => void;
@@ -159,6 +160,7 @@ export function SettingsPanel({
onBlurChange,
motionBlurAmount = 0,
onMotionBlurChange,
+ onMotionBlurCommit,
borderRadius = 0,
onBorderRadiusChange,
onBorderRadiusCommit,
@@ -595,7 +597,7 @@ export function SettingsPanel({
<Slider
value={[motionBlurAmount]}
onValueChange={(values) => onMotionBlurChange?.(values[0])}
- onValueCommit={(values) => onMotionBlurChange?.(values[0])}
+ onValueCommit={() => onMotionBlurCommit?.()}
min={0}
max={1}
step={0.01}
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index cae81a400..b3bdb8da6 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -1370,7 +1370,8 @@ export default function VideoEditor() {
showBlur={showBlur}
onBlurChange={(v) => pushState({ showBlur: v })}
motionBlurAmount={motionBlurAmount}
- onMotionBlurChange={(v) => pushState({ motionBlurAmount: v })}
+ onMotionBlurChange={(v) => updateState({ motionBlurAmount: v })}
+ onMotionBlurCommit={commitState}
borderRadius={borderRadius}
onBorderRadiusChange={(v) => updateState({ borderRadius: v })}
onBorderRadiusCommit={commitState}