Skip to content

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

refactor: remove redundant quick background toggle

webadderallb5255b7c72e5
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index 7926e0a0..6bc2cdfb 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -266,10 +266,6 @@ export function SettingsPanel({
const [customImages, setCustomImages] = useState<string[]>(
initialEditorPreferences.customWallpapers,
);
- const removeBackgroundStateRef = useRef<{
- aspectRatio: AspectRatio;
- padding: number;
- } | null>(null);
const fileInputRef = useRef<HTMLInputElement>(null);
useEffect(() => {
@@ -315,7 +311,6 @@ export function SettingsPanel({
const [gradient, setGradient] = useState<string>(
GRADIENTS.includes(selected) ? selected : GRADIENTS[0],
);
- const removeBackgroundEnabled = aspectRatio === "native" && padding === 0;
const [backgroundTab, setBackgroundTab] = useState<BackgroundTab>(() =>
getBackgroundTabForWallpaper(selected),
);
@@ -342,24 +337,6 @@ export function SettingsPanel({
saveEditorPreferences({ customWallpapers: customImages });
}, [customImages]);
- const handleRemoveBackgroundToggle = (checked: boolean) => {
- if (checked) {
- removeBackgroundStateRef.current = {
- aspectRatio,
- padding,
- };
- onAspectRatioChange?.("native");
- onPaddingChange?.(0);
- return;
- }
-
- if (removeBackgroundStateRef.current) {
- onAspectRatioChange?.(removeBackgroundStateRef.current.aspectRatio);
- onPaddingChange?.(removeBackgroundStateRef.current.padding);
- removeBackgroundStateRef.current = null;
- }
- };
-
const webcamFileName = webcam?.sourcePath?.split(/[\\/]/).pop() ?? null;
const zoomEnabled = Boolean(selectedZoomDepth);
@@ -884,14 +861,6 @@ export function SettingsPanel({
parseInput={(t) => parseFloat(t.replace(/%$/, ""))}
/>
</div>
- <div className="col-span-2 flex items-center justify-between p-2 rounded-lg bg-white/5 border border-white/5">
- <div className="text-[10px] font-medium text-slate-300">{tSettings("effects.removeBackground")}</div>
- <Switch
- checked={removeBackgroundEnabled}
- onCheckedChange={handleRemoveBackgroundToggle}
- className="data-[state=checked]:bg-[#2563EB] scale-90"
- />
- </div>
</div>
<Button
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index f0eaf679..1823ec34 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -39,8 +39,7 @@
"webcamShadow": "Webcam Shadow",
"shadow": "Shadow",
"roundness": "Roundness",
- "padding": "Padding",
- "removeBackground": "Remove background"
+ "padding": "Padding"
},
"crop": {
"title": "Crop Video",
diff --git a/src/i18n/locales/es/settings.json b/src/i18n/locales/es/settings.json
index d5a6c708..439d42f1 100644
--- a/src/i18n/locales/es/settings.json
+++ b/src/i18n/locales/es/settings.json
@@ -39,8 +39,7 @@
"webcamShadow": "Sombra de cámara",
"shadow": "Sombra",
"roundness": "Redondez",
- "padding": "Relleno",
- "removeBackground": "Quitar fondo"
+ "padding": "Relleno"
},
"crop": {
"title": "Recortar video",
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index 7ed4bf4c..b2a17f46 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -39,8 +39,7 @@
"webcamShadow": "摄像头阴影",
"shadow": "阴影",
"roundness": "圆角",
- "padding": "内边距",
- "removeBackground": "移除背景"
+ "padding": "内边距"
},
"crop": {
"title": "裁剪视频",