Skip to content

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

feat(editor): camera roundness slider and anchored positions

EtienneLescotc30d1331a239
diff --git a/README.md b/README.md
index 992f41656..de72920f8 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,7 @@ A raw capture goes in and comes out ready to post — on X, Reddit, YouTube, a d
## Core Features
- Record a specific window, or your whole screen.
- Record microphone and system audio.
-- Webcam overlay with picture-in-picture, drag-to-position, mirroring, and shape options.
+- Webcam overlay with picture-in-picture, eight snap positions, adjustable roundness, mirroring, and shape options.
- Auto or manual zooms with adjustable depth, duration, easing, and pixel-precise position; auto-zoom follows your cursor as you work.
- Custom cursor size, smoothing, and click effects, with cursor themes and post-recording path smoothing.
- Automatic captions for voiceovers, transcribed on-device with no upload (works offline), with an editable transcript you can cut from and optional subtitle translation.
diff --git a/electron/ai-edition/style-preset-service.test.ts b/electron/ai-edition/style-preset-service.test.ts
index 41dd78eff..d98b3d03a 100644
--- a/electron/ai-edition/style-preset-service.test.ts
+++ b/electron/ai-edition/style-preset-service.test.ts
@@ -19,6 +19,7 @@ const APPEARANCE: StylePresetAppearance = {
padding: 50,
webcamLayoutPreset: "picture-in-picture",
webcamMaskShape: "rectangle",
+ webcamRoundness: 0.3,
webcamMirrored: false,
webcamReactiveZoom: true,
webcamSizePreset: 25,
diff --git a/electron/ipc/nativeBridge.presets.test.ts b/electron/ipc/nativeBridge.presets.test.ts
index 7228f5352..9fa094f8d 100644
--- a/electron/ipc/nativeBridge.presets.test.ts
+++ b/electron/ipc/nativeBridge.presets.test.ts
@@ -39,6 +39,7 @@ const APPEARANCE: StylePresetAppearance = {
padding: 50,
webcamLayoutPreset: "picture-in-picture",
webcamMaskShape: "rectangle",
+ webcamRoundness: 0.3,
webcamMirrored: false,
webcamReactiveZoom: true,
webcamSizePreset: 25,
diff --git a/src/components/ai-edition/PreviewCanvas.tsx b/src/components/ai-edition/PreviewCanvas.tsx
index bdb88b9d0..f0950c82b 100644
--- a/src/components/ai-edition/PreviewCanvas.tsx
+++ b/src/components/ai-edition/PreviewCanvas.tsx
@@ -53,10 +53,10 @@ import {
resolveWebcamLayoutPreset,
type WebcamCompositeLayout,
} from "@/lib/compositeLayout";
+import { webcamAnchorAt } from "@/lib/projectDefaults";
import { classifyWallpaper, resolveImageWallpaperUrl } from "@/lib/wallpaper";
import { getCssClipPath } from "@/lib/webcamMaskShapes";
import { computeCameraFullscreenProgress } from "@/lib/zoomMath/cameraFullscreenUtils";
-import { clamp01 } from "@/utils/math";
import { AnnotationLayer } from "./AnnotationLayer";
import { NativeCompositorOverlay } from "./NativeCompositorOverlay";
import styles from "./NewEditorShell.module.css";
@@ -269,12 +269,10 @@ export function PreviewCanvas(props: PreviewCanvasProps) {
webcamSize: preset === "no-webcam" ? null : WEBCAM_SOURCE_SIZE,
layoutPreset: preset,
webcamSizePreset: settings.webcamSizePreset,
- // ponytail: PiP webcam is grabbable. Pass through the user's
- // position so the layout math places it at the dragged spot, not
- // the legacy default. Dual-frame / vertical-stack / no-webcam ignore
- // it (their preset definitions hardcode their own placement).
- webcamPosition: preset === "picture-in-picture" ? settings.webcamPosition : null,
+ // Picture-in-picture only: the block layouts place and round their own camera.
+ webcamAnchor: settings.webcamAnchor,
webcamMaskShape: mask,
+ webcamRoundness: settings.webcamRoundness,
});
}, [
frameSize,
@@ -284,7 +282,8 @@ export function PreviewCanvas(props: PreviewCanvasProps) {
settings.webcamLayoutPreset,
settings.webcamMaskShape,
settings.webcamSizePreset,
- settings.webcamPosition,
+ settings.webcamAnchor,
+ settings.webcamRoundness,
settings.padding,
settings.aspectRatio,
]);
@@ -373,12 +372,19 @@ export function PreviewCanvas(props: PreviewCanvasProps) {
const offsetY = event.clientY - (slotRect.top + slotRect.height / 2);
slot.setPointerCapture(event.pointerId);
+ // The camera snaps to the anchor nearest where it would sit if it followed the pointer,
+ // so it is always somewhere it can be left: a corner or an edge middle.
+ let anchor = settings.webcamAnchor;
const handleMove = (e: PointerEvent) => {
const frameNow = frameRef.current?.getBoundingClientRect();
if (!frameNow) return;
- const cx = clamp01((e.clientX - offsetX - frameNow.left) / frameNow.width);
- const cy = clamp01((e.clientY - offsetY - frameNow.top) / frameNow.height);
- setLive({ webcamPosition: { cx, cy } });
+ const next = webcamAnchorAt(
+ (e.clientX - offsetX - frameNow.left) / frameNow.width,
+ (e.clientY - offsetY - frameNow.top) / frameNow.height,
+ );
+ if (next === anchor) return;
+ anchor = next;
+ setLive({ webcamAnchor: next });
};
const handleUp = () => {
slot.removeEventListener("pointermove", handleMove);
diff --git a/src/components/ai-edition/RightPanes.layout.test.tsx b/src/components/ai-edition/RightPanes.layout.test.tsx
index 32d9c1cd7..1a3d054c0 100644
--- a/src/components/ai-edition/RightPanes.layout.test.tsx
+++ b/src/components/ai-edition/RightPanes.layout.test.tsx
@@ -127,9 +127,9 @@ describe("LayoutPane camera availability", () => {
expect(screen.getByText("Camera shape")).toBeInTheDocument();
expect(screen.getByText("Shrink on zoom")).toBeInTheDocument();
expect(screen.getByText("Webcam size")).toBeInTheDocument();
- expect(screen.getByRole("button", { name: "Rounded" })).toBeEnabled();
- // Named, because the pane holds four sliders now — webcam size plus the three
- // webcam-framing ones. This one is the size slider the line above just found.
+ expect(screen.getByRole("button", { name: "Square" })).toBeEnabled();
+ // Named, because the pane holds several sliders. This one is the size slider the
+ // line above just found.
expect(screen.getByRole("slider", { name: "Webcam size" })).toBeEnabled();
// The camera-less hint must not leak into the normal case.
@@ -154,6 +154,53 @@ describe("LayoutPane webcam framing picture", () => {
});
});
+describe("LayoutPane picture-in-picture camera", () => {
+ const stored = () => useProjectStore.getState().document?.legacyEditor as Record<string, unknown>;
+
+ it("sets the shape and its roundness as two separate settings", () => {
+ renderLayout(seedProject(true));
+ const shapes = within(screen.getByRole("group", { name: "Camera shape" })).getAllByRole(
+ "button",
+ );
+ expect(shapes.map((b) => b.textContent)).toEqual(["Rectangle", "Square"]);
+ fireEvent.click(screen.getByRole("button", { name: "Square" }));
+ expect(stored()).toMatchObject({ webcamMaskShape: "square" });
+ fireEvent.change(screen.getByRole("slider", { name: "Roundness" }), {
+ target: { value: "100" },
+ });
+ // Each control moves its own axis only: full roundness leaves the shape a square.
+ expect(stored()).toMatchObject({ webcamMaskShape: "square", webcamRoundness: 1 });
+ });
+
+ it("places the camera on one of eight anchors, bottom right by default", () => {
+ renderLayout(seedProject(true));
+ const grid = screen.getByRole("group", { name: "Position" });
+ expect(within(grid).getAllByRole("button")).toHaveLength(8);
+ expect(within(grid).getByRole("button", { name: "Bottom right" })).toHaveAttribute(
+ "aria-pressed",
+ "true",
+ );
+ fireEvent.click(within(grid).getByRole("button", { name: "Top left" }));
+ expect(stored()).toMatchObject({ webcamAnchor: "top-left" });
+ });
+
+ // The middle of the frame is a hole in the grid, not a ninth place to land.
+ it("steps over the middle of the grid with the arrow keys", () => {
+ renderLayout(seedProject(true));
+ const grid = screen.getByRole("group", { name: "Position" });
+ const left = within(grid).getByRole("button", { name: "Left" });
+ left.focus();
+ fireEvent.keyDown(left, { key: "ArrowRight" });
+ expect(within(grid).getByRole("button", { name: "Right" })).toHaveFocus();
+ expect(stored()).toMatchObject({ webcamAnchor: "right" });
+ });
+
+ it("keeps the camera under 35% of the frame", () => {
+ renderLayout(seedProject(true));
+ expect(screen.getByRole("slider", { name: "Webcam size" })).toHaveAttribute("max", "35");
+ });
+});
+
// #412. The pan used to be read back out of the crop rect, which cannot hold it: at 100%
// zoom the crop IS the frame, so its offset is 0 for every pan the user could have chosen.
// A trip down to 100% therefore erased the framing rather than suspending it.
diff --git a/src/components/ai-edition/RightPanes.tsx b/src/components/ai-edition/RightPanes.tsx
index 8be27fdf9..9fcfa9a3a 100644
--- a/src/components/ai-edition/RightPanes.tsx
+++ b/src/components/ai-edition/RightPanes.tsx
@@ -102,6 +102,12 @@ import {
type FrameTheme,
RECORDING_FRAMES,
type RecordingFrame,
+ WEBCAM_ANCHOR_GRID,
+ WEBCAM_SIZE_MAX,
+ WEBCAM_SIZE_MIN,
+ type WebcamAnchor,
+ type WebcamMask,
+ webcamAnchorFractions,
} from "@/lib/projectDefaults";
import {
classifyWallpaper,
@@ -2875,28 +2881,49 @@ const WEBCAM_PRESETS = [
// (1 = fixture default), so the slider reads as a direct multiplier on the shipped webcam.
const NATIVE_WEBCAM_BASE_PCT = 16.7;
-const CAMERA_SHAPES: Array<{
- value: "rectangle" | "circle" | "square" | "rounded";
- labelKey: string;
- icon: ReactNode;
-}> = [
- {
- value: "rectangle",
- labelKey: "layout.shapes.rectangle",
- icon: <rect x="3" y="6" width="18" height="12" rx="1" />,
- },
- { value: "circle", labelKey: "layout.shapes.circle", icon: <circle cx="12" cy="12" r="9" /> },
- {
- value: "square",
- labelKey: "layout.shapes.square",
- icon: <rect x="4" y="4" width="16" height="16" rx="1" />,
- },
- {
- value: "rounded",
- labelKey: "layout.shapes.rounded",
- icon: <rect x="3" y="6" width="18" height="12" rx="6" />,
- },
-];
+// The camera's two proportions. Its rounding is the slider under them, and each icon draws it.
+const CAMERA_SHAPES = [
+ { value: "rectangle", labelKey: "layout.shapes.rectangle", x: 3, y: 6, w: 18, h: 12 },
+ { value: "square", labelKey: "layout.shapes.square", x: 4, y: 4, w: 16, h: 16 },
+] as const satisfies ReadonlyArray<{ value: WebcamMask } & Record<string, unknown>>;
+
+const ANCHOR_KEYS: Record<WebcamAnchor, string> = {
+ "top-left": "layout.anchors.topLeft",
+ top: "layout.anchors.top",
+ "top-right": "layout.anchors.topRight",
+ left: "layout.anchors.left",
+ right: "layout.anchors.right",
+ "bottom-left": "layout.anchors.bottomLeft",
+ bottom: "layout.anchors.bottom",
+ "bottom-right": "layout.anchors.bottomRight",
+};
+
+/** The frame, with the camera where this anchor puts it (viewBox 0 0 32 22, as the presets). */
+function anchorIcon(anchor: WebcamAnchor) {
+ const [fx, fy] = webcamAnchorFractions(anchor);
+ return (
+ <svg
+ viewBox="0 0 32 22"
+ width={32}
+ height={22}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.75"
+ aria-hidden="true"
+ >
+ <rect x="1.5" y="1.5" width="29" height="19" rx="3" />
+ <rect
+ x={4 + fx * 16}
+ y={4 + fy * 8}
+ width="8"
+ height="6"
+ rx="1.5"
+ fill="currentColor"
+ stroke="none"
+ />
+ </svg>
+ );
+}
// The camera-background control used to be gated on the platform: the mask is produced by the
// native compositor, and Linux carried the shader branch with nothing feeding it, so `fx.z`
@@ -3090,88 +3117,91 @@ export function LayoutPane() {
{isPip ? (
<>
<div className={styles.sectionLabel}>{ts("layout.webcamShape")}</div>
- <div
- style={{
- display: "grid",
- // `minmax(0, 1fr)` et non `1fr`. `1fr` vaut `minmax(auto, 1fr)`,
- // donc la taille MINIMALE de la piste est `auto`, ce qui resout
- // pour chaque bouton a son minimum de contenu -- et « Rounded »
- // est un mot insecable. Quatre boutons a 64,83 px plus trois
- // gouttieres de 8 px reclamaient 283,3 px la ou le panneau n'en
- // offre que 234 : les pistes refusaient de retrecir et la grille
- // debordait, en coupant le dernier bouton. `minmax(0, ...)`
- // autorise la piste a passer sous son contenu.
- gridTemplateColumns: "repeat(4, minmax(0, 1fr))",
- gap: 8,
- padding: "0 var(--sp-4) 12px",
- }}
- >
- {CAMERA_SHAPES.map((shape) => {
- const isActive = settings.webcamMaskShape === shape.value;
- return (
- <button
- type="button"
- key={shape.value}
- className={`${styles.cursorCell} ${isActive ? styles.isActive : ""}`}
- style={{
- flexDirection: "column",
- gap: 4,
- padding: "8px 4px",
- display: "flex",
- alignItems: "center",
- // Sans `minWidth: 0` le bouton garde son minimum de
- // contenu et rouvre le debordement que `minmax(0, 1fr)`
- // vient de fermer sur la piste.
- minWidth: 0,
- }}
- disabled={layoutControlsDisabled}
- onClick={() => {
- void set({ webcamMaskShape: shape.value });
- if (isNativeCompositorActive()) {
- setNativeParam("webcamShape", shape.value);
- }
- }}
- >
+ <div style={{ padding: "0 var(--sp-4) 12px" }}>
+ <ChoiceRow<WebcamMask>
+ label={ts("layout.webcamShape")}
+ display="both"
+ tiles
+ options={CAMERA_SHAPES.map((shape) => ({
+ value: shape.value,
+ label: ts(shape.labelKey),
+ icon: (
<svg
viewBox="0 0 24 24"
+ width={22}
+ height={22}
fill="none"
stroke="currentColor"
strokeWidth="2"
- width={22}
- height={22}
+ aria-hidden="true"
>
- {shape.icon}
+ <rect
+ x={shape.x}
+ y={shape.y}
+ width={shape.w}
+ height={shape.h}
+ rx={(settings.webcamRoundness * Math.min(shape.w, shape.h)) / 2}
+ />
</svg>
- <span title={ts(shape.labelKey)} style={{ font: "500 12px/1 var(--font-body)" }}>
- {ts(shape.labelKey)}
- </span>
- </button>
- );
- })}
+ ),
+ }))}
+ value={settings.webcamMaskShape}
+ disabled={layoutControlsDisabled}
+ onChange={(shape) => {
+ void set({ webcamMaskShape: shape });
+ if (isNativeCompositorActive()) {
+ setNativeParam("webcamShape", shape);
+ }
+ }}
+ />
+ </div>
+ <div className={styles.sliderGrid}>
+ <SliderCell
+ full
+ label={ts("effects.roundness")}
+ value={Math.round(settings.webcamRoundness * 100)}
+ min={0}
+ max={100}
+ suffix="%"
+ disabled={layoutControlsDisabled}
+ onChange={(next) => setLive({ webcamRoundness: next / 100 })}
+ onCommit={() => void commit()}
+ />
+ <SliderCell
+ full
+ label={ts("layout.webcamSize")}
+ value={settings.webcamSizePreset}
+ min={WEBCAM_SIZE_MIN}
+ max={WEBCAM_SIZE_MAX}
+ step={1}
+ suffix="%"
+ disabled={layoutControlsDisabled}
+ onChange={(next) => {
+ setLive({ webcamSizePreset: next });
+ if (isNativeCompositorActive()) {
+ setNativeParam("webcamSize", next / NATIVE_WEBCAM_BASE_PCT);
+ }
+ }}
+ onCommit={() => void commit()}
+ />
+ </div>
+ <div className={styles.sectionLabel}>{ts("layout.webcamPosition")}</div>
+ <div style={{ padding: "0 var(--sp-4) 12px" }}>
+ <ChoiceRow<WebcamAnchor>
+ label={ts("layout.webcamPosition")}
+ columns={3}
+ options={WEBCAM_ANCHOR_GRID.flat().map((anchor) =>
+ anchor === null
+ ? null
+ : { value: anchor, label: ts(ANCHOR_KEYS[anchor]), icon: anchorIcon(anchor) },
+ )}
+ value={settings.webcamAnchor}
+ disabled={layoutControlsDisabled}
+ onChange={(anchor) => void set({ webcamAnchor: anchor })}
+ />
</div>
</>
) : null}
- {isPip ? (
- <div className={styles.sliderGrid}>
- <SliderCell
- full
- label={ts("layout.webcamSize")}
- value={settings.webcamSizePreset}
- min={10}
- max={50}
- step={1}
- suffix="%"
- disabled={layoutControlsDisabled}
- onChange={(next) => {
- setLive({ webcamSizePreset: next });
- if (isNativeCompositorActive()) {
- setNativeParam("webcamSize", next / NATIVE_WEBCAM_BASE_PCT);
- }
- }}
- onCommit={() => void commit()}
- />
- </div>
- ) : null}
{/* Le seul contrôle de l'éditeur dont l'effet dépend d'un binaire optionnel : sans la
bibliothèque ONNX Runtime, le compositeur dessine la webcam telle quelle et le réglage
ne fait rien. On demande donc à la machine plutôt que de deviner depuis la plateforme —
@@ -3902,7 +3932,8 @@ export function ChoiceRow<T extends string | number>({
display,
}: {
label: string;
- options: ReadonlyArray<{ value: T; label: string; icon?: ReactNode }>;
+ /** `null` leaves a hole in the grid: the middle of the camera's position grid. */
+ options: ReadonlyArray<{ value: T; label: string; icon?: ReactNode } | null>;
value: T;
onChange: (next: T) => void;
disabled?: boolean;
@@ -3915,7 +3946,7 @@ export function ChoiceRow<T extends string | number>({
display?: "text" | "icon" | "both";
}) {
const buttonsRef = useRef<Array<HTMLButtonElement | null>>([]);
- const mode = display ?? (options.some((o) => o.icon) ? "icon" : "text");
+ const mode = display ?? (options.some((o) => o?.icon) ? "icon" : "text");
return (
<div
role="group"
@@ -3937,14 +3968,17 @@ export function ChoiceRow<T extends string | number>({
e.preventDefault();
e.nativeEvent.stopPropagation();
const focused = buttonsRef.current.findIndex((b) => b === document.activeElement);
- const from = focused >= 0 ? focused : options.findIndex((o) => o.value === value);
- const next = options[from + step];
+ const from = focused >= 0 ? focused : options.findIndex((o) => o?.value === value);
+ // A hole is stepped over, not landed on.
+ const to = options[from + step] === null ? from + 2 * step : from + step;
+ const next = options[to];
if (!next) return;
- buttonsRef.current[from + step]?.focus();
+ buttonsRef.current[to]?.focus();
if (next.value !== value) onChange(next.value);
}}
>
{options.map((option, i) => {
+ if (option === null) return <span key={`hole-${i}`} aria-hidden="true" />;
const pressed = option.value === value;
return (
<button
diff --git a/src/i18n/locales/ar/settings.json b/src/i18n/locales/ar/settings.json
index 26051a0f7..100be30b1 100644
--- a/src/i18n/locales/ar/settings.json
+++ b/src/i18n/locales/ar/settings.json
@@ -272,17 +272,26 @@
"mute": "كتم"
},
"layout": {
- "help": "طريقة دمج كاميرا الويب مع الشاشة: صورة داخل صورة، أو تكديس عمودي، أو إطار مزدوج، وشكل القناع والحجم والانعكاس.",
+ "help": "طريقة دمج كاميرا الويب مع الشاشة: صورة داخل صورة، أو تكديس عمودي، أو إطار مزدوج، والشكل والاستدارة والحجم والموضع والانعكاس.",
"mirrorWebcam": "عكس كاميرا الويب",
"webcamFraming": "تأطير كاميرا الويب",
"webcamFramingDrag": "اسحب الإطار لاختيار ما تعرضه الكاميرا.",
"webcamFramingZoomFirst": "كبّر الصورة ثم اسحب الإطار لاختيار ما تعرضه الكاميرا.",
"shapes": {
"rectangle": "مستطيل",
- "rounded": "زوايا مستديرة",
- "circle": "دائرة",
"square": "مربع"
},
+ "webcamPosition": "الموضع",
+ "anchors": {
+ "topLeft": "أعلى اليسار",
+ "top": "أعلى",
+ "topRight": "أعلى اليمين",
+ "left": "اليسار",
+ "right": "اليمين",
+ "bottomLeft": "أسفل اليسار",
+ "bottom": "أسفل",
+ "bottomRight": "أسفل اليمين"
+ },
"selectPreset": "حدد إعدادًا مسبقًا",
"bgModes": {
"custom": "مخصص",
diff --git a/src/i18n/locales/cs/settings.json b/src/i18n/locales/cs/settings.json
index 43e80c523..e5e1be7f6 100644
--- a/src/i18n/locales/cs/settings.json
+++ b/src/i18n/locales/cs/settings.json
@@ -272,17 +272,26 @@
"mute": "Ztlumit"
},
"layout": {
- "help": "Jak je webkamera složena s obrazovkou: obraz v obrazu, svislé skládání, dvojitý rám, tvar masky, velikost a zrcadlení.",
+ "help": "Jak je webkamera složena s obrazovkou: obraz v obrazu, svislé skládání, dvojitý rám, tvar, zaoblení, velikost, poloha a zrcadlení.",
"mirrorWebcam": "Zrcadlit webkameru",
"webcamFraming": "Oříznutí kamery",
"webcamFramingDrag": "Přetažením rámečku zvolte, co kamera ukáže.",
"webcamFramingZoomFirst": "Přibližte obraz a přetažením rámečku zvolte, co kamera ukáže.",
"shapes": {
"rectangle": "Obdélník",
- "rounded": "Zaoblený",
- "circle": "Kruh",
"square": "Čtverec"
},
+ "webcamPosition": "Poloha",
+ "anchors": {
+ "topLeft": "Vlevo nahoře",
+ "top": "Nahoře",
+ "topRight": "Vpravo nahoře",
+ "left": "Vlevo",
+ "right": "Vpravo",
+ "bottomLeft": "Vlevo dole",
+ "bottom": "Dole",
+ "bottomRight": "Vpravo dole"
+ },
"selectPreset": "Vybrat předvolbu",
"bgModes": {
"custom": "Vlastní",
diff --git a/src/i18n/locales/de/settings.json b/src/i18n/locales/de/settings.json
index 85d7ddd38..a2479ad90 100644
--- a/src/i18n/locales/de/settings.json
+++ b/src/i18n/locales/de/settings.json
@@ -272,17 +272,26 @@
"mute": "Stumm"
},
"layout": {
- "help": "Wie die Webcam mit dem Bildschirm komponiert wird: Bild in Bild, vertikal gestapelt, Doppelrahmen, Maskenform, Größe und Spiegelung.",
+ "help": "Wie die Webcam mit dem Bildschirm komponiert wird: Bild in Bild, vertikal gestapelt, Doppelrahmen, Form, Rundung, Größe, Position und Spiegelung.",
"mirrorWebcam": "Webcam spiegeln",
"webcamFraming": "Webcam-Ausschnitt",
"webcamFramingDrag": "Ziehe den Rahmen, um den Bildausschnitt der Kamera zu wählen.",
"webcamFramingZoomFirst": "Zoome hinein und ziehe dann den Rahmen, um den Bildausschnitt der Kamera zu wählen.",
"shapes": {
"rectangle": "Rechteck",
- "rounded": "Gerundet",
- "circle": "Kreis",
"square": "Quadrat"
},
+ "webcamPosition": "Position",
+ "anchors": {
+ "topLeft": "Oben links",
+ "top": "Oben",
+ "topRight": "Oben rechts",
+ "left": "Links",
+ "right": "Rechts",
+ "bottomLeft": "Unten links",
+ "bottom": "Unten",
+ "bottomRight": "Unten rechts"
+ },
"selectPreset": "Vorgabe auswählen",
"bgModes": {
"custom": "Eigenes",
diff --git a/src/i18n/locales/en/settings.json b/src/i18n/locales/en/settings.json
index f0569d52a..e4957152a 100644
--- a/src/i18n/locales/en/settings.json
+++ b/src/i18n/locales/en/settings.json
@@ -272,17 +272,26 @@
"mute": "Mute"
},
"layout": {
- "help": "How the webcam is composed with the screen: picture-in-picture, vertical stack, dual frame, mask shape, size, and mirroring.",
+ "help": "How the webcam is composed with the screen: picture-in-picture, vertical stack, dual frame, shape, roundness, size, position, and mirroring.",
"mirrorWebcam": "Mirror webcam",
"webcamFraming": "Webcam crop",
"webcamFramingDrag": "Drag the frame to choose what the camera shows.",
"webcamFramingZoomFirst": "Zoom in, then drag the frame to choose what the camera shows.",
"shapes": {
- "rectangle": "Rect",
- "rounded": "Rounded",
- "circle": "Circle",
+ "rectangle": "Rectangle",
"square": "Square"
},
+ "webcamPosition": "Position",
+ "anchors": {
+ "topLeft": "Top left",
+ "top": "Top",
+ "topRight": "Top right",
+ "left": "Left",
+ "right": "Right",
+ "bottomLeft": "Bottom left",
+ "bottom": "Bottom",
+ "bottomRight": "Bottom right"
+ },
"selectPreset": "Select preset",
"bgModes": {
"custom": "Custom",
diff --git a/src/i18n/locales/es/settings.json b/src/i18n/locales/es/settings.json
index bf97d9f39..16f5c7a79 100644
--- a/src/i18n/locales/es/settings.json
+++ b/src/i18n/locales/es/settings.json
@@ -272,17 +272,26 @@
"mute": "Silenciar"
},
"layout": {
- "help": "Cómo se compone la webcam con la pantalla: imagen en imagen, pila vertical, marco doble, forma de máscara, tamaño y efecto espejo.",
+ "help": "Cómo se compone la webcam con la pantalla: imagen en imagen, pila vertical, marco doble, forma, redondez, tamaño, posición y efecto espejo.",
"mirrorWebcam": "Reflejar cámara",
"webcamFraming": "Encuadre de cámara",
"webcamFramingDrag": "Arrastra el marco para elegir lo que muestra la cámara.",
"webcamFramingZoomFirst": "Acerca el zoom y arrastra el marco para elegir lo que muestra la cámara.",
"shapes": {
- "rectangle": "Rect.",
- "rounded": "Redondeado",
- "circle": "Círculo",
+ "rectangle": "Rectángulo",
"square": "Cuadrado"
},
+ "webcamPosition": "Posición",
+ "anchors": {
+ "topLeft": "Arriba a la izquierda",
+ "top": "Arriba",
+ "topRight": "Arriba a la derecha",
+ "left": "Izquierda",
+ "right": "Derecha",
+ "bottomLeft": "Abajo a la izquierda",
+ "bottom": "Abajo",
+ "bottomRight": "Abajo a la derecha"
+ },
"selectPreset": "Seleccionar predefinido",
"bgModes": {
"custom": "Personalizado",
diff --git a/src/i18n/locales/fr/settings.json b/src/i18n/locales/fr/settings.json
index 978f7f021..b8cb772a2 100644
--- a/src/i18n/locales/fr/settings.json
+++ b/src/i18n/locales/fr/settings.json
@@ -272,17 +272,26 @@
"mute": "Muet"
},
"layout": {
- "help": "Composition de la webcam avec l'écran : incrustation, empilement vertical, double cadre, forme du masque, taille et effet miroir.",
+ "help": "Composition de la webcam avec l'écran : incrustation, empilement vertical, double cadre, forme, arrondi, taille, position et effet miroir.",
"mirrorWebcam": "Inverser la webcam",
"webcamFraming": "Cadrage de la webcam",
"webcamFramingDrag": "Faites glisser le cadre pour choisir ce que montre la caméra.",
"webcamFramingZoomFirst": "Zoomez, puis faites glisser le cadre pour choisir ce que montre la caméra.",
"shapes": {
- "rectangle": "Rect.",
- "rounded": "Arrondi",
- "circle": "Cercle",
+ "rectangle": "Rectangle",
"square": "Carré"
},
+ "webcamPosition": "Position",
+ "anchors": {
+ "topLeft": "En haut à gauche",
+ "top": "En haut",
+ "topRight": "En haut à droite",
+ "left": "À gauche",
+ "right": "À droite",
+ "bottomLeft": "En bas à gauche",
+ "bottom": "En bas",
+ "bottomRight": "En bas à droite"
+ },
"selectPreset": "Choisir un préréglage",
"bgModes": {
"custom": "Personnalisé",
diff --git a/src/i18n/locales/it/settings.json b/src/i18n/locales/it/settings.json
index 95e0c6a6d..23ad7a651 100644
--- a/src/i18n/locales/it/settings.json
+++ b/src/i18n/locales/it/settings.json
@@ -272,17 +272,26 @@
"mute": "Muto"
},
"layout": {
- "help": "Come la webcam viene composta con lo schermo: picture-in-picture, pila verticale, doppio riquadro, forma della maschera, dimensione e effetto specchio.",
+ "help": "Come la webcam viene composta con lo schermo: picture-in-picture, pila verticale, doppio riquadro, forma, arrotondamento, dimensione, posizione e effetto specchio.",
"mirrorWebcam": "Specchia webcam",
"webcamFraming": "Inquadratura webcam",
"webcamFramingDrag": "Trascina il riquadro per scegliere cosa mostra la fotocamera.",
"webcamFramingZoomFirst": "Aumenta lo zoom, poi trascina il riquadro per scegliere cosa mostra la fotocamera.",
"shapes": {
- "rectangle": "Rett.",
- "rounded": "Arrotondato",
- "circle": "Cerchio",
+ "rectangle": "Rettangolo",
"square": "Quadrato"
},
+ "webcamPosition": "Posizione",
+ "anchors": {
+ "topLeft": "In alto a sinistra",
+ "top": "In alto",
+ "topRight": "In alto a destra",
+ "left": "A sinistra",
+ "right": "A destra",
+ "bottomLeft": "In basso a sinistra",
+ "bottom": "In basso",
+ "bottomRight": "In basso a destra"
+ },
"selectPreset": "Seleziona predefinito",
"bgModes": {
"custom": "Personalizzato",
diff --git a/src/i18n/locales/ja-JP/settings.json b/src/i18n/locales/ja-JP/settings.json
index 518143984..8e3a4dfdb 100644
--- a/src/i18n/locales/ja-JP/settings.json
+++ b/src/i18n/locales/ja-JP/settings.json
@@ -272,17 +272,26 @@
"mute": "ミュート"
},
"layout": {
- "help": "ウェブカメラと画面の合成方法: ピクチャインピクチャ、縦積み、デュアルフレーム、マスク形状、サイズ、左右反転。",
+ "help": "ウェブカメラと画面の合成方法: ピクチャインピクチャ、縦積み、デュアルフレーム、形状、丸み、サイズ、位置、左右反転。",
"mirrorWebcam": "Webカメラを反転",
"webcamFraming": "ウェブカメラの構図",
"webcamFramingDrag": "枠をドラッグして、カメラに映す範囲を選びます。",
"webcamFramingZoomFirst": "ズームしてから枠をドラッグし、カメラに映す範囲を選びます。",
"shapes": {
"rectangle": "長方形",
- "rounded": "角丸",
- "circle": "円",
"square": "正方形"
},
+ "webcamPosition": "位置",
+ "anchors": {
+ "topLeft": "左上",
+ "top": "上",
+ "topRight": "右上",
+ "left": "左",
+ "right": "右",
+ "bottomLeft": "左下",
+ "bottom": "下",
+ "bottomRight": "右下"
+ },
"selectPreset": "プリセットを選択",
"bgModes": {
"custom": "カスタム",
diff --git a/src/i18n/locales/ko-KR/settings.json b/src/i18n/locales/ko-KR/settings.json
index d89c08a28..6a46098fc 100644
--- a/src/i18n/locales/ko-KR/settings.json
+++ b/src/i18n/locales/ko-KR/settings.json
@@ -272,17 +272,26 @@
"mute": "음소거"
},
"layout": {
- "help": "웹캠과 화면을 합성하는 방식: PIP, 세로 배치, 이중 프레임, 마스크 모양, 크기, 좌우 반전.",
+ "help": "웹캠과 화면을 합성하는 방식: PIP, 세로 배치, 이중 프레임, 모양, 모서리 둥글기, 크기, 위치, 좌우 반전.",
"mirrorWebcam": "웹캠 미러링",
"webcamFraming": "웹캠 구도",
"webcamFramingDrag": "프레임을 드래그해 카메라에 보일 부분을 고르세요.",
"webcamFramingZoomFirst": "확대한 다음 프레임을 드래그해 카메라에 보일 부분을 고르세요.",
"shapes": {
"rectangle": "직사각형",
- "rounded": "둥근 모서리",
- "circle": "원형",
"square": "정사각형"
},
+ "webcamPosition": "위치",
+ "anchors": {
+ "topLeft": "왼쪽 위",
+ "top": "위",
+ "topRight": "오른쪽 위",
+ "left": "왼쪽",
+ "right": "오른쪽",
+ "bottomLeft": "왼쪽 아래",
+ "bottom": "아래",
+ "bottomRight": "오른쪽 아래"
+ },
"selectPreset": "프리셋 선택",
"bgModes": {
"custom": "사용자 지정",
diff --git a/src/i18n/locales/pt-BR/settings.json b/src/i18n/locales/pt-BR/settings.json
index 4e12e6966..9cf5dc48e 100644
--- a/src/i18n/locales/pt-BR/settings.json
+++ b/src/i18n/locales/pt-BR/settings.json
@@ -272,17 +272,26 @@
"mute": "Silenciar"
},
"layout": {
- "help": "Como a webcam é composta com a tela: picture-in-picture, pilha vertical, quadro duplo, formato da máscara, tamanho e espelhamento.",
+ "help": "Como a webcam é composta com a tela: picture-in-picture, pilha vertical, quadro duplo, formato, arredondamento, tamanho, posição e espelhamento.",
"mirrorWebcam": "Espelhar Webcam",
"webcamFraming": "Enquadramento da webcam",
"webcamFramingDrag": "Arraste o quadro para escolher o que a câmera mostra.",
"webcamFramingZoomFirst": "Aumente o zoom e arraste o quadro para escolher o que a câmera mostra.",
"shapes": {
- "rectangle": "Ret.",
- "rounded": "Arredondado",
- "circle": "Círculo",
+ "rectangle": "Retângulo",
"square": "Quadrado"
},
+ "webcamPosition": "Posição",
+ "anchors": {
+ "topLeft": "Superior esquerdo",
+ "top": "Superior",
+ "topRight": "Superior direito",
+ "left": "Esquerda",
+ "right": "Direita",
+ "bottomLeft": "Inferior esquerdo",
+ "bottom": "Inferior",
+ "bottomRight": "Inferior direito"
+ },
"selectPreset": "Selecionar predefinição",
"bgModes": {
"custom": "Personalizado",
diff --git a/src/i18n/locales/ru/settings.json b/src/i18n/locales/ru/settings.json
index 9bd91d936..89359ce7b 100644
--- a/src/i18n/locales/ru/settings.json
+++ b/src/i18n/locales/ru/settings.json
@@ -272,17 +272,26 @@
"mute": "Без звука"
},
"layout": {
- "help": "Как камера совмещается с экраном: «картинка в картинке», вертикальная стопка, двойной кадр, форма маски, размер и зеркальное отражение.",
+ "help": "Как камера совмещается с экраном: «картинка в картинке», вертикальная стопка, двойной кадр, форма, скругление, размер, положение и зеркальное отражение.",
"mirrorWebcam": "Зеркалить веб-камеру",
"webcamFraming": "Кадрирование веб-камеры",
"webcamFramingDrag": "Перетащите рамку, чтобы выбрать, что показывает камера.",
"webcamFramingZoomFirst": "Увеличьте масштаб, затем перетащите рамку, чтобы выбрать, что показывает камера.",
"shapes": {
- "rectangle": "Прямоуг.",
- "rounded": "Скруглённый",
- "circle": "Круг",
+ "rectangle": "Прямоугольник",
"square": "Квадрат"
},
+ "webcamPosition": "Положение",
+ "anchors": {
+ "topLeft": "Слева вверху",
+ "top": "Вверху",
+ "topRight": "Справа вверху",
+ "left": "Слева",
+ "right": "Справа",
+ "bottomLeft": "Слева внизу",
+ "bottom": "Внизу",
+ "bottomRight": "Справа внизу"
+ },
"selectPreset": "Выбрать пресет",
"bgModes": {
"custom": "Пользовательский",
diff --git a/src/i18n/locales/tr/settings.json b/src/i18n/locales/tr/settings.json
index a355c34c0..46d43abec 100644
--- a/src/i18n/locales/tr/settings.json
+++ b/src/i18n/locales/tr/settings.json
@@ -272,17 +272,26 @@
"mute": "Sessiz"
},
"layout": {
- "help": "Web kamerasının ekranla birleştirilme biçimi: resim içinde resim, dikey yığın, çift çerçeve, maske şekli, boyut ve aynalama.",
+ "help": "Web kamerasının ekranla birleştirilme biçimi: resim içinde resim, dikey yığın, çift çerçeve, şekil, yuvarlaklık, boyut, konum ve aynalama.",
"mirrorWebcam": "Web kamerasını aynala",
"webcamFraming": "Webcam kadrajı",
"webcamFramingDrag": "Kameranın ne göstereceğini seçmek için çerçeveyi sürükleyin.",
"webcamFramingZoomFirst": "Yakınlaştırın, ardından kameranın ne göstereceğini seçmek için çerçeveyi sürükleyin.",
"shapes": {
"rectangle": "Dikdörtgen",
- "rounded": "Yuvarlatılmış",
- "circle": "Daire",
"square": "Kare"
},
+ "webcamPosition": "Konum",
+ "anchors": {
+ "topLeft": "Sol üst",
+ "top": "Üst",
+ "topRight": "Sağ üst",
+ "left": "Sol",
+ "right": "Sağ",
+ "bottomLeft": "Sol alt",
+ "bottom": "Alt",
+ "bottomRight": "Sağ alt"
+ },
"selectPreset": "Ön ayar seçin",
"bgModes": {
"custom": "Özel",
diff --git a/src/i18n/locales/vi/settings.json b/src/i18n/locales/vi/settings.json
index 838ffaefb..11c4ac50e 100644
--- a/src/i18n/locales/vi/settings.json
+++ b/src/i18n/locales/vi/settings.json
@@ -272,17 +272,26 @@
"mute": "Tắt tiếng"
},
"layout": {
- "help": "Cách ghép webcam với màn hình: hình trong hình, xếp dọc, khung đôi, hình dạng mặt nạ, kích thước và lật gương.",
+ "help": "Cách ghép webcam với màn hình: hình trong hình, xếp dọc, khung đôi, hình dạng, độ bo tròn, kích thước, vị trí và lật gương.",
"mirrorWebcam": "Lật webcam",
"webcamFraming": "Khung hình webcam",
"webcamFramingDrag": "Kéo khung để chọn phần camera hiển thị.",
"webcamFramingZoomFirst": "Phóng to, rồi kéo khung để chọn phần camera hiển thị.",
"shapes": {
"rectangle": "Chữ nhật",
- "rounded": "Bo góc",
- "circle": "Tròn",
"square": "Vuông"
},
+ "webcamPosition": "Vị trí",
+ "anchors": {
+ "topLeft": "Trên cùng bên trái",
+ "top": "Trên cùng",
+ "topRight": "Trên cùng bên phải",
+ "left": "Bên trái",
+ "right": "Bên phải",
+ "bottomLeft": "Dưới cùng bên trái",
+ "bottom": "Dưới cùng",
+ "bottomRight": "Dưới cùng bên phải"
+ },
"selectPreset": "Chọn cài đặt sẵn",
"bgModes": {
"custom": "Tùy chỉnh",
diff --git a/src/i18n/locales/zh-CN/settings.json b/src/i18n/locales/zh-CN/settings.json
index 5af14f5fc..d18fd8d46 100644
--- a/src/i18n/locales/zh-CN/settings.json
+++ b/src/i18n/locales/zh-CN/settings.json
@@ -272,17 +272,26 @@
"mute": "静音"
},
"layout": {
- "help": "摄像头与屏幕的合成方式:画中画、垂直堆叠、双画面、遮罩形状、大小和镜像。",
+ "help": "摄像头与屏幕的合成方式:画中画、垂直堆叠、双画面、形状、圆角、大小、位置和镜像。",
"mirrorWebcam": "镜像摄像头",
"webcamFraming": "摄像头构图",
"webcamFramingDrag": "拖动取景框,选择摄像头显示的范围。",
"webcamFramingZoomFirst": "先放大,再拖动取景框,选择摄像头显示的范围。",
"shapes": {
"rectangle": "矩形",
- "rounded": "圆角",
- "circle": "圆形",
"square": "正方形"
},
+ "webcamPosition": "位置",
+ "anchors": {
+ "topLeft": "左上",
+ "top": "上方",
+ "topRight": "右上",
+ "left": "左侧",
+ "right": "右侧",
+ "bottomLeft": "左下",
+ "bottom": "下方",
+ "bottomRight": "右下"
+ },
"selectPreset": "选择预设",
"bgModes": {
"custom": "自定义",
diff --git a/src/i18n/locales/zh-TW/settings.json b/src/i18n/locales/zh-TW/settings.json
index 423c59340..66b592ed5 100644
--- a/src/i18n/locales/zh-TW/settings.json
+++ b/src/i18n/locales/zh-TW/settings.json
@@ -272,17 +272,26 @@
"mute": "靜音"
},
"layout": {
- "help": "攝影機與螢幕的合成方式:子母畫面、垂直堆疊、雙畫面、遮罩形狀、大小與鏡像。",
+ "help": "攝影機與螢幕的合成方式:子母畫面、垂直堆疊、雙畫面、形狀、圓角、大小、位置與鏡像。",
"mirrorWebcam": "鏡像攝影機",
"webcamFraming": "攝影機構圖",
"webcamFramingDrag": "拖曳取景框,選擇攝影機顯示的範圍。",
"webcamFramingZoomFirst": "先放大,再拖曳取景框,選擇攝影機顯示的範圍。",
"shapes": {
"rectangle": "矩形",
- "rounded": "圓角",
- "circle": "圓形",
"square": "正方形"
},
+ "webcamPosition": "位置",
+ "anchors": {
+ "topLeft": "左上",
+ "top": "上方",
+ "topRight": "右上",
+ "left": "左側",
+ "right": "右側",
+ "bottomLeft": "左下",
+ "bottom": "下方",
+ "bottomRight": "右下"
+ },
"selectPreset": "選擇預設",
"bgModes": {
"custom": "自訂",
diff --git a/src/lib/ai-edition/store/editorSettings.test.ts b/src/lib/ai-edition/store/editorSettings.test.ts
index e4eeefac2..6e382c58f 100644
--- a/src/lib/ai-edition/store/editorSettings.test.ts
+++ b/src/lib/ai-edition/store/editorSettings.test.ts
@@ -73,7 +73,9 @@ describe("getEditorSettings", () => {
expect(snap.shadowIntensity).toBe(0.5);
expect(snap.showBlur).toBe(true);
expect(snap.webcamLayoutPreset).toBe("side-by-side");
- expect(snap.webcamMaskShape).toBe("circle");
+ // An old circle: a square camera, fully round.
+ expect(snap.webcamMaskShape).toBe("square");
+ expect(snap.webcamRoundness).toBe(1);
expect(snap.cursor.size).toBe(5);
expect(snap.cursor.smoothing).toBe(0.8);
});
@@ -163,21 +165,40 @@ describe("patchEditorSettings", () => {
expect(after).toEqual(before);
});
- it("round-trips webcamPosition through legacyEditor", () => {
- const dragged = patchEditorSettings(baseDoc, {
- webcamPosition: { cx: 0.32, cy: 0.71 },
- });
- const snap = getEditorSettings(dragged);
- expect(snap.webcamPosition).toEqual({ cx: 0.32, cy: 0.71 });
+ it("round-trips webcamAnchor through legacyEditor", () => {
+ const dragged = patchEditorSettings(baseDoc, { webcamAnchor: "top-left" });
+ expect(getEditorSettings(dragged).webcamAnchor).toBe("top-left");
});
- it("clamps out-of-range webcamPosition when reading", () => {
- const doc: AxcutDocument = {
- ...baseDoc,
- legacyEditor: { webcamPosition: { cx: 1.7, cy: -0.4 } },
+ // Older builds let the camera be dropped anywhere and stored its centre.
+ it("reads a free position stored by an older build as the nearest anchor", () => {
+ const anchorOf = (cx: number, cy: number) =>
+ getEditorSettings({ ...baseDoc, legacyEditor: { webcamPosition: { cx, cy } } }).webcamAnchor;
+ expect(anchorOf(0.1, 0.9)).toBe("bottom-left");
+ expect(anchorOf(0.5, 0.1)).toBe("top");
+ expect(anchorOf(1.7, -0.4)).toBe("top-right");
+ // From the middle of the frame, the nearer edge.
+ expect(anchorOf(0.52, 0.6)).toBe("bottom");
+ expect(anchorOf(0.4, 0.48)).toBe("left");
+ expect(getEditorSettings(baseDoc).webcamAnchor).toBe("bottom-right");
+ });
+
+ it("splits the old circle and rounded shapes into a proportion and a roundness", () => {
+ const read = (legacyEditor: Record<string, unknown>) => {
+ const snap = getEditorSettings({ ...baseDoc, legacyEditor });
+ return [snap.webcamMaskShape, snap.webcamRoundness];
};
- const snap = getEditorSettings(doc);
- expect(snap.webcamPosition).toEqual({ cx: 1, cy: 0 });
+ expect(read({ webcamMaskShape: "circle" })).toEqual(["square", 1]);
+ expect(read({ webcamMaskShape: "rounded" })).toEqual(["rectangle", 0.6]);
+ expect(read({ webcamMaskShape: "square" })).toEqual(["square", 0.3]);
+ // A stored roundness wins over the one the shape implied, and stays in 0..1.
+ expect(read({ webcamMaskShape: "circle", webcamRoundness: 0.2 })).toEqual(["square", 0.2]);
+ expect(read({ webcamRoundness: 4 })).toEqual(["rectangle", 1]);
+ });
+
+ it("reads a camera size past the slider's 35% as 35%", () => {
+ const doc: AxcutDocument = { ...baseDoc, legacyEditor: { webcamSizePreset: 50 } };
+ expect(getEditorSettings(doc).webcamSizePreset).toBe(35);
});
it("preserves a non-zero crop at the bottom-right edge", () => {
diff --git a/src/lib/ai-edition/store/editorSettings.ts b/src/lib/ai-edition/store/editorSettings.ts
index 3dc779097..ed3342256 100644
--- a/src/lib/ai-edition/store/editorSettings.ts
+++ b/src/lib/ai-edition/store/editorSettings.ts
@@ -12,7 +12,6 @@ import {
type CropRegion,
type CursorVisualSettings,
DEFAULT_CROP_REGION,
- DEFAULT_WEBCAM_POSITION,
isWallpaperMotion,
isWebcamBackgroundMode,
type WallpaperMotion,
@@ -28,9 +27,15 @@ import {
isFrameTheme,
type RecordingFrame,
readRecordingFrame,
+ readWebcamAnchor,
+ readWebcamMask,
+ WEBCAM_SIZE_MAX,
+ WEBCAM_SIZE_MIN,
+ type WebcamAnchor,
+ type WebcamMask,
} from "@/lib/projectDefaults";
import type { AspectRatio } from "@/utils/aspectRatioUtils";
-import { clamp01 } from "@/utils/math";
+import { clamp, clamp01 } from "@/utils/math";
import type { AxcutDocument } from "../schema";
// ponytail: avoid dragging in lib/exporter full surface here — we only
@@ -97,11 +102,15 @@ export interface EditorSettingsSnapshot {
padding: number;
cropRegion: CropRegion;
webcamLayoutPreset: WebcamLayoutPreset;
- webcamMaskShape: WebcamMaskShape;
+ /** The camera's proportions. `circle` and `rounded` are read as a roundness: see `readWebcamMask`. */
+ webcamMaskShape: WebcamMask;
+ /** 0 square corners to 1 fully round, a fraction of half the camera's short side. */
+ webcamRoundness: number;
webcamMirrored: boolean;
webcamReactiveZoom: boolean;
webcamSizePreset: WebcamSizePreset;
- webcamPosition: WebcamPosition | null;
+ /** Where the picture-in-picture camera sits, at a constant distance from the border. */
+ webcamAnchor: WebcamAnchor;
webcamCropRegion: CropRegion;
/** Where the crop window sits in the room the zoom leaves it, 0..1 per axis.
* Authoritative: `webcamCropRegion.x/y` are rebuilt from it on read. */
@@ -146,9 +155,12 @@ interface LegacyShape {
cropRegion?: CropRegion;
webcamLayoutPreset?: WebcamLayoutPreset;
webcamMaskShape?: WebcamMaskShape;
+ webcamRoundness?: number;
webcamMirrored?: boolean;
webcamReactiveZoom?: boolean;
webcamSizePreset?: WebcamSizePreset;
+ webcamAnchor?: WebcamAnchor;
+ /** Written by builds that let the camera be dragged anywhere; read as the nearest anchor. */
webcamPosition?: WebcamPosition | null;
webcamCropRegion?: CropRegion;
webcamCropPan?: CropPan;
@@ -202,6 +214,9 @@ export function getEditorSettings(doc: AxcutDocument | null | undefined): Editor
// drift apart — on disk, or in a patch that wrote one and not the other. Only the SIZE
// survives from the stored rect; `pan * (1 - size)` is a position that cannot leave the
// frame, which is why nothing here clamps it.
+ // `circle` and `rounded` were a proportion and a rounding in one value; they split here.
+ const webcamMask = readWebcamMask(legacy?.webcamMaskShape, legacy?.webcamRoundness);
+
const storedCrop = normaliseCropRegion(legacy?.webcamCropRegion);
const webcamCropPan = normaliseCropPan(legacy?.webcamCropPan, storedCrop);
const webcamCrop: CropRegion = {
@@ -231,14 +246,19 @@ export function getEditorSettings(doc: AxcutDocument | null | undefined): Editor
padding: num(legacy?.padding, DEFAULT_EDITOR_SETTINGS.padding),
cropRegion: legacy?.cropRegion ?? DEFAULT_EDITOR_SETTINGS.cropRegion,
webcamLayoutPreset: legacy?.webcamLayoutPreset ?? DEFAULT_EDITOR_SETTINGS.webcamLayoutPreset,
- webcamMaskShape: legacy?.webcamMaskShape ?? DEFAULT_EDITOR_SETTINGS.webcamMaskShape,
+ webcamMaskShape: webcamMask.shape,
+ webcamRoundness: webcamMask.roundness,
webcamMirrored: bool(legacy?.webcamMirrored, DEFAULT_EDITOR_SETTINGS.webcamMirrored),
webcamReactiveZoom: bool(
legacy?.webcamReactiveZoom,
DEFAULT_EDITOR_SETTINGS.webcamReactiveZoom,
),
- webcamSizePreset: num(legacy?.webcamSizePreset, DEFAULT_EDITOR_SETTINGS.webcamSizePreset),
- webcamPosition: normaliseWebcamPosition(legacy?.webcamPosition),
+ webcamSizePreset: clamp(
+ num(legacy?.webcamSizePreset, DEFAULT_EDITOR_SETTINGS.webcamSizePreset),
+ WEBCAM_SIZE_MIN,
+ WEBCAM_SIZE_MAX,
+ ),
+ webcamAnchor: readWebcamAnchor(legacy?.webcamAnchor, legacy?.webcamPosition),
webcamCropRegion: webcamCrop,
webcamCropPan: webcamCropPan,
// Same bound the slider offers and the native `finish_audio` clamps to. Two
@@ -278,11 +298,12 @@ export interface EditorSettingsPatch {
padding?: number;
cropRegion?: CropRegion;
webcamLayoutPreset?: WebcamLayoutPreset;
- webcamMaskShape?: WebcamMaskShape;
+ webcamMaskShape?: WebcamMask;
+ webcamRoundness?: number;
webcamMirrored?: boolean;
webcamReactiveZoom?: boolean;
webcamSizePreset?: WebcamSizePreset;
- webcamPosition?: WebcamPosition | null;
+ webcamAnchor?: WebcamAnchor;
webcamCropRegion?: CropRegion;
webcamCropPan?: CropPan;
audioGainDb?: number;
@@ -331,20 +352,6 @@ export function patchEditorSettings(doc: AxcutDocument, patch: EditorSettingsPat
};
}
-// Normalise a webcam position from legacy storage. Anything outside 0-1 is
-// clamped so a malformed `legacyEditor` doesn't seed the drag with bad coords.
-function normaliseWebcamPosition(value: unknown): WebcamPosition | null {
- if (!value || typeof value !== "object") return DEFAULT_WEBCAM_POSITION;
- const candidate = value as Record<string, unknown>;
- const cxRaw = candidate.cx;
- const cyRaw = candidate.cy;
- if (typeof cxRaw !== "number" || typeof cyRaw !== "number") return DEFAULT_WEBCAM_POSITION;
- return {
- cx: Math.min(1, Math.max(0, cxRaw)),
- cy: Math.min(1, Math.max(0, cyRaw)),
- };
-}
-
const MIN_CROP_SIZE = 0.01;
/**
diff --git a/src/lib/ai-edition/stylePresets.test.ts b/src/lib/ai-edition/stylePresets.test.ts
index 8c0377585..8e948218e 100644
--- a/src/lib/ai-edition/stylePresets.test.ts
+++ b/src/lib/ai-edition/stylePresets.test.ts
@@ -26,7 +26,8 @@ function appearance(overrides: Partial<StylePresetAppearance> = {}): StylePreset
borderRadius: 40,
padding: 50,
webcamLayoutPreset: "picture-in-picture",
- webcamMaskShape: "circle",
+ webcamMaskShape: "square",
+ webcamRoundness: 1,
webcamMirrored: true,
webcamReactiveZoom: true,
webcamSizePreset: 25,
@@ -68,6 +69,21 @@ describe("parseStylePresetAppearance", () => {
).toThrow(/wallpaperMotion/);
});
+ // `circle` and `rounded` were a proportion and a rounding in one value.
+ it("reads a preset saved before the camera roundness existed", () => {
+ const { webcamRoundness: _roundness, ...older } = appearance();
+ const read = (webcamMaskShape: string) => {
+ const parsed = parseStylePresetAppearance({ ...older, webcamMaskShape });
+ return [parsed.webcamMaskShape, parsed.webcamRoundness];
+ };
+ expect(read("circle")).toEqual(["square", 1]);
+ expect(read("rounded")).toEqual(["rectangle", 0.6]);
+ expect(read("rectangle")).toEqual(["rectangle", 0.3]);
+ expect(() => parseStylePresetAppearance({ ...appearance(), webcamRoundness: 2 })).toThrow(
+ /webcamRoundness/,
+ );
+ });
+
it("keeps depth of field on for a preset saved before the setting existed", () => {
const { depthOfField: _dof, ...older } = appearance({ depthOfField: false });
expect(parseStylePresetAppearance(older).depthOfField).toBe(true);
diff --git a/src/lib/ai-edition/stylePresets.ts b/src/lib/ai-edition/stylePresets.ts
index ae87d5d19..6fdd1e92f 100644
--- a/src/lib/ai-edition/stylePresets.ts
+++ b/src/lib/ai-edition/stylePresets.ts
@@ -25,6 +25,8 @@ import {
isFrameTheme,
type RecordingFrame,
readRecordingFrame,
+ readWebcamMask,
+ type WebcamMask,
} from "../projectDefaults";
export const STYLE_PRESET_FILE_EXTENSION = ".openscreenpreset";
@@ -52,7 +54,8 @@ export interface StylePresetAppearance {
borderRadius: number;
padding: number;
webcamLayoutPreset: WebcamLayoutPreset;
- webcamMaskShape: WebcamMaskShape;
+ webcamMaskShape: WebcamMask;
+ webcamRoundness: number;
webcamMirrored: boolean;
webcamReactiveZoom: boolean;
webcamSizePreset: WebcamSizePreset;
@@ -118,7 +121,10 @@ const NUMBER_RANGES = {
motionBlurAmount: [0, 1],
borderRadius: [0, 64],
padding: [0, 100],
+ // Wider than the slider's 10-35: presets saved when it reached 50 still apply, and the
+ // editor reads anything past 35 as 35.
webcamSizePreset: [10, 50],
+ webcamRoundness: [0, 1],
webcamBlurIntensity: [0, 1],
} as const;
const CURSOR_NUMBER_RANGES = {
@@ -163,6 +169,21 @@ function readEnum<T extends string>(source: Fields, key: string, allowed: readon
return value as T;
}
+/**
+ * The camera's proportions and roundness. A preset saved before the roundness existed carries
+ * `circle` or `rounded`, a proportion and a rounding in one value: `readWebcamMask` splits it
+ * the way the editor reads an old project.
+ */
+function readWebcamShape(source: Fields): { webcamMaskShape: WebcamMask; webcamRoundness: number } {
+ const shape = readEnum(source, "webcamMaskShape", WEBCAM_MASK_SHAPES);
+ const roundness =
+ source.webcamRoundness === undefined
+ ? undefined
+ : readNumber(source, "webcamRoundness", NUMBER_RANGES.webcamRoundness);
+ const mask = readWebcamMask(shape, roundness);
+ return { webcamMaskShape: mask.shape, webcamRoundness: mask.roundness };
+}
+
/**
* The frame and its theme. A version-1 preset may omit both: every preset written before the
* frame existed lacks them, and "no frame, light" is exactly what those presets looked like.
@@ -277,7 +298,7 @@ export function parseStylePresetAppearance(value: unknown): StylePresetAppearanc
borderRadius: readNumber(value, "borderRadius", NUMBER_RANGES.borderRadius),
padding: readNumber(value, "padding", NUMBER_RANGES.padding),
webcamLayoutPreset: readEnum(value, "webcamLayoutPreset", WEBCAM_LAYOUT_PRESETS),
- webcamMaskShape: readEnum(value, "webcamMaskShape", WEBCAM_MASK_SHAPES),
+ ...readWebcamShape(value),
webcamMirrored: readBoolean(value, "webcamMirrored"),
webcamReactiveZoom: readBoolean(value, "webcamReactiveZoom"),
webcamSizePreset: readNumber(value, "webcamSizePreset", NUMBER_RANGES.webcamSizePreset),
diff --git a/src/lib/ai-edition/stylePresetsEditor.test.ts b/src/lib/ai-edition/stylePresetsEditor.test.ts
index ddf470618..b63dcd769 100644
--- a/src/lib/ai-edition/stylePresetsEditor.test.ts
+++ b/src/lib/ai-edition/stylePresetsEditor.test.ts
@@ -17,7 +17,7 @@ const EXCLUDED_KEYS = [
"cropRegion",
"webcamCropRegion",
"webcamCropPan",
- "webcamPosition",
+ "webcamAnchor",
"audioGainDb",
"autoFocusAll",
] as const;
@@ -36,10 +36,11 @@ function styledSettings(): EditorSettingsSnapshot {
borderRadius: 12,
padding: 20,
webcamLayoutPreset: "dual-frame",
- webcamMaskShape: "rounded",
+ webcamMaskShape: "square",
+ webcamRoundness: 0.45,
webcamMirrored: true,
webcamReactiveZoom: false,
- webcamSizePreset: 40,
+ webcamSizePreset: 30,
webcamBackgroundMode: "custom",
webcamWallpaper: "#123456",
webcamBlurIntensity: 0.9,
@@ -79,7 +80,7 @@ describe("stylePresetsEditor", () => {
// A project with its own footage-dependent state, still on the factory look.
const base = patchEditorSettings(createEmptyDocument({ projectId: "proj_a", title: "A" }), {
cropRegion: { x: 0.1, y: 0.1, width: 0.5, height: 0.5 },
- webcamPosition: { cx: 0.2, cy: 0.8 },
+ webcamAnchor: "bottom-left",
audioGainDb: 6,
autoFocusAll: true,
});
diff --git a/src/lib/ai-edition/stylePresetsEditor.ts b/src/lib/ai-edition/stylePresetsEditor.ts
index 43b94c5a1..cb8565e46 100644
--- a/src/lib/ai-edition/stylePresetsEditor.ts
+++ b/src/lib/ai-edition/stylePresetsEditor.ts
@@ -27,6 +27,7 @@ export function stylePresetAppearanceFromSettings(
padding: settings.padding,
webcamLayoutPreset: settings.webcamLayoutPreset,
webcamMaskShape: settings.webcamMaskShape,
+ webcamRoundness: settings.webcamRoundness,
webcamMirrored: settings.webcamMirrored,
webcamReactiveZoom: settings.webcamReactiveZoom,
webcamSizePreset: settings.webcamSizePreset,
@@ -73,6 +74,7 @@ export function stylePresetPatch(appearance: StylePresetAppearance): EditorSetti
padding: appearance.padding,
webcamLayoutPreset: appearance.webcamLayoutPreset,
webcamMaskShape: appearance.webcamMaskShape,
+ webcamRoundness: appearance.webcamRoundness,
webcamMirrored: appearance.webcamMirrored,
webcamReactiveZoom: appearance.webcamReactiveZoom,
webcamSizePreset: appearance.webcamSizePreset,
diff --git a/src/lib/compositeLayout.test.ts b/src/lib/compositeLayout.test.ts
index 49a2346a4..6632359d9 100644
--- a/src/lib/compositeLayout.test.ts
+++ b/src/lib/compositeLayout.test.ts
@@ -10,6 +10,7 @@ import {
restingCompositionAspect,
type StyledRenderRect,
} from "./compositeLayout";
+import type { WebcamAnchor } from "./projectDefaults";
describe("resolveWebcamReactiveZoom", () => {
it("honours the stored setting for picture-in-picture", () => {
@@ -428,26 +429,50 @@ describe("computeCompositeLayout", () => {
expect(squareLayout?.webcamRect?.maskShape).toBe("square");
});
- it("applies larger rounding for the rounded webcam mask", () => {
- const roundedLayout = computeCompositeLayout({
+ const pipAt = (over: Partial<Parameters<typeof computeCompositeLayout>[0]>) =>
+ computeCompositeLayout({
canvasSize: { width: 1920, height: 1080 },
screenSize: { width: 1920, height: 1080 },
webcamSize: { width: 1280, height: 720 },
- webcamMaskShape: "rounded",
- });
- const rectangleLayout = computeCompositeLayout({
- canvasSize: { width: 1920, height: 1080 },
- screenSize: { width: 1920, height: 1080 },
- webcamSize: { width: 1280, height: 720 },
- webcamMaskShape: "rectangle",
- });
+ ...over,
+ })!.webcamRect!;
+
+ // A fraction of half the short side: the same value is the same shape at any size.
+ it("rounds by the roundness, and a fully round square is a circle", () => {
+ const circle = pipAt({ webcamMaskShape: "square", webcamRoundness: 1 });
+ expect(circle.width).toBe(circle.height);
+ expect(circle.borderRadius).toBe(circle.width / 2);
+ expect(pipAt({ webcamRoundness: 0 }).borderRadius).toBe(0);
+ const pill = pipAt({ webcamRoundness: 1 });
+ expect(pill.borderRadius).toBe(Math.round(Math.min(pill.width, pill.height) / 2));
+ const small = pipAt({ webcamRoundness: 0.5, webcamSizePreset: 10 });
+ const large = pipAt({ webcamRoundness: 0.5, webcamSizePreset: 35 });
+ expect(small.borderRadius / small.height).toBeCloseTo(large.borderRadius / large.height, 2);
+ });
- expect(roundedLayout?.webcamRect).not.toBeNull();
- expect(rectangleLayout?.webcamRect).not.toBeNull();
- expect(roundedLayout?.webcamRect?.borderRadius).toBeGreaterThan(
- rectangleLayout?.webcamRect?.borderRadius ?? 0,
- );
- expect(roundedLayout?.webcamRect?.maskShape).toBe("rounded");
+ // The camera never ends up against an edge or over the middle of the screen: every anchor
+ // keeps the same distance from the border, whatever the camera's size.
+ it("keeps the same margin from the border at every anchor", () => {
+ const margin = Math.round(1080 * 0.02);
+ for (const size of [10, 35]) {
+ const at = (webcamAnchor: WebcamAnchor) => pipAt({ webcamAnchor, webcamSizePreset: size });
+ expect(at("top-left")).toMatchObject({ x: margin, y: margin });
+ const br = at("bottom-right");
+ expect(br.x + br.width).toBe(1920 - margin);
+ expect(br.y + br.height).toBe(1080 - margin);
+ const top = at("top");
+ expect(top.y).toBe(margin);
+ expect(Math.abs(top.x + top.width / 2 - 960)).toBeLessThanOrEqual(1);
+ const left = at("left");
+ expect(left.x).toBe(margin);
+ expect(Math.abs(left.y + left.height / 2 - 540)).toBeLessThanOrEqual(1);
+ expect(at("bottom").y + at("bottom").height).toBe(1080 - margin);
+ expect(at("right").x + at("right").width).toBe(1920 - margin);
+ }
+ });
+
+ it("caps the camera at 35% of the short side", () => {
+ expect(pipAt({ webcamSizePreset: 50 }).height).toBe(pipAt({ webcamSizePreset: 35 }).height);
});
});
diff --git a/src/lib/compositeLayout.ts b/src/lib/compositeLayout.ts
index 3de597a95..4319790ba 100644
--- a/src/lib/compositeLayout.ts
+++ b/src/lib/compositeLayout.ts
@@ -1,3 +1,12 @@
+import {
+ DEFAULT_WEBCAM_ROUNDNESS,
+ WEBCAM_SIZE_MAX,
+ WEBCAM_SIZE_MIN,
+ type WebcamAnchor,
+ webcamAnchorFractions,
+} from "@/lib/projectDefaults";
+import { clamp01 } from "@/utils/math";
+
export interface RenderRect {
x: number;
y: number;
@@ -170,15 +179,17 @@ export interface WebcamCompositeLayout {
screenCover?: boolean;
}
-/** Convert a webcam size percentage (10–50) to a fraction (0..1) of the reference dimension. */
+/** Convert a webcam size percentage (10–35) to a fraction (0..1) of the reference dimension. */
export function webcamSizeToFraction(percent: number): number {
const safe = Number.isFinite(percent) ? percent : 25;
- const clamped = Math.max(10, Math.min(50, safe));
+ const clamped = Math.max(WEBCAM_SIZE_MIN, Math.min(WEBCAM_SIZE_MAX, safe));
return clamped / 100;
}
const MARGIN_FRACTION = 0.02;
const MAX_BORDER_RADIUS = 24;
+/** Picture-in-picture rounds by the user's `webcamRoundness`, and no-webcam draws no camera. */
+const NO_PRESET_ROUNDING = { max: 0, min: 0, fraction: 0 };
/**
* Breathing room between the screen box and the camera box inside a block layout,
* as a fraction of the screen's own width. Expressed against the screen (not the
@@ -205,11 +216,7 @@ const WEBCAM_LAYOUT_PRESET_MAP: Record<WebcamLayoutPreset, WebcamLayoutPresetDef
minMargin: 0,
minSize: 0,
},
- borderRadius: {
- max: MAX_BORDER_RADIUS,
- min: 12,
- fraction: 0.12,
- },
+ borderRadius: NO_PRESET_ROUNDING,
shadow: {
color: "rgba(0,0,0,0.35)",
blur: 24,
@@ -253,11 +260,7 @@ const WEBCAM_LAYOUT_PRESET_MAP: Record<WebcamLayoutPreset, WebcamLayoutPresetDef
minMargin: 0,
minSize: 0,
},
- borderRadius: {
- max: 0,
- min: 0,
- fraction: 0,
- },
+ borderRadius: NO_PRESET_ROUNDING,
shadow: null,
},
};
@@ -357,8 +360,11 @@ export function computeCompositeLayout(params: {
webcamSize?: Size | null;
layoutPreset?: WebcamLayoutPreset;
webcamSizePreset?: WebcamSizePreset;
- webcamPosition?: { cx: number; cy: number } | null;
+ /** Picture-in-picture only: where the camera sits. The block layouts place their own. */
+ webcamAnchor?: WebcamAnchor;
webcamMaskShape?: import("@/components/video-editor/types").WebcamMaskShape;
+ /** Picture-in-picture only: 0 square corners to 1 fully round. */
+ webcamRoundness?: number;
}): WebcamCompositeLayout | null {
const {
canvasSize,
@@ -367,8 +373,9 @@ export function computeCompositeLayout(params: {
webcamSize,
layoutPreset = "picture-in-picture",
webcamSizePreset = 25,
- webcamPosition,
+ webcamAnchor = "bottom-right",
webcamMaskShape = "rectangle",
+ webcamRoundness = DEFAULT_WEBCAM_ROUNDNESS,
} = params;
const { width: canvasWidth, height: canvasHeight } = canvasSize;
const { width: screenWidth, height: screenHeight } = screenSize;
@@ -535,37 +542,15 @@ export function computeCompositeLayout(params: {
height = side;
}
- let webcamX: number;
- let webcamY: number;
-
- if (webcamPosition) {
- // cx/cy are the webcam center as a fraction of the canvas.
- webcamX = Math.round(webcamPosition.cx * canvasWidth - width / 2);
- webcamY = Math.round(webcamPosition.cy * canvasHeight - height / 2);
- // Clamp inside canvas bounds.
- webcamX = Math.max(0, Math.min(canvasWidth - width, webcamX));
- webcamY = Math.max(0, Math.min(canvasHeight - height, webcamY));
- } else {
- // Default: bottom-right with margin
- webcamX = Math.max(0, Math.round(canvasWidth - margin - width));
- webcamY = Math.max(0, Math.round(canvasHeight - margin - height));
- }
+ // The anchor's corner or edge middle, the same margin from the border whatever the
+ // camera's size: the camera takes 0, a half or all of the room it leaves on each axis.
+ const [fx, fy] = webcamAnchorFractions(webcamAnchor);
+ const webcamX = Math.max(0, Math.round(margin + fx * (canvasWidth - 2 * margin - width)));
+ const webcamY = Math.max(0, Math.round(margin + fy * (canvasHeight - 2 * margin - height)));
- // Shape-specific border radius
- let borderRadius: number;
- if (webcamMaskShape === "rounded") {
- borderRadius = Math.round(Math.min(width, height) * 0.3);
- } else if (webcamMaskShape === "circle") {
- borderRadius = Math.round(Math.min(width, height) / 2);
- } else {
- borderRadius = Math.min(
- preset.borderRadius.max,
- Math.max(
- preset.borderRadius.min,
- Math.round(Math.min(width, height) * preset.borderRadius.fraction),
- ),
- );
- }
+ // A fraction of half the short side, so the shape holds at any size and resolution:
+ // at 1 a square camera is a circle, a rectangular one a pill.
+ const borderRadius = Math.round((clamp01(webcamRoundness) * Math.min(width, height)) / 2);
return {
screenRect,
diff --git a/src/lib/projectDefaults.ts b/src/lib/projectDefaults.ts
index 6f5a1d497..6ac1e1172 100644
--- a/src/lib/projectDefaults.ts
+++ b/src/lib/projectDefaults.ts
@@ -64,6 +64,104 @@ export function readRecordingFrame(
return isRecordingFrame(value) ? { frame: value } : null;
}
+/**
+ * Where the picture-in-picture camera sits: a corner or the middle of an edge, always the
+ * same distance from the border of the frame. Never a free position: a camera dropped
+ * anywhere else ended up against an edge or over the middle of the screen.
+ */
+export const WEBCAM_ANCHORS = [
+ "top-left",
+ "top",
+ "top-right",
+ "left",
+ "right",
+ "bottom-left",
+ "bottom",
+ "bottom-right",
+] as const;
+
+export type WebcamAnchor = (typeof WEBCAM_ANCHORS)[number];
+
+export function isWebcamAnchor(value: unknown): value is WebcamAnchor {
+ return (WEBCAM_ANCHORS as readonly unknown[]).includes(value);
+}
+
+/** The anchor grid, row by row. The middle cell is no place for a camera. */
+export const WEBCAM_ANCHOR_GRID = [
+ ["top-left", "top", "top-right"],
+ ["left", null, "right"],
+ ["bottom-left", "bottom", "bottom-right"],
+] as const satisfies readonly (readonly (WebcamAnchor | null)[])[];
+
+/**
+ * The anchor nearest a point of the frame, in fractions of it: the cell of a 3x3 grid, and
+ * from the middle cell the nearer edge. What the camera snaps to when it is dragged, and what
+ * a free position stored by an older build reads as.
+ */
+export function webcamAnchorAt(cx: number, cy: number): WebcamAnchor {
+ const cell = (v: number) => (v < 1 / 3 ? 0 : v > 2 / 3 ? 2 : 1);
+ let col = cell(cx);
+ let row = cell(cy);
+ if (col === 1 && row === 1) {
+ if (Math.abs(cy - 0.5) >= Math.abs(cx - 0.5)) row = cy < 0.5 ? 0 : 2;
+ else col = cx < 0.5 ? 0 : 2;
+ }
+ return WEBCAM_ANCHOR_GRID[row][col] ?? "bottom-right";
+}
+
+/** An anchor as the share of the free room the camera leaves it, per axis: 0, 0.5 or 1. */
+export function webcamAnchorFractions(anchor: WebcamAnchor): [number, number] {
+ const fx = anchor.endsWith("left") ? 0 : anchor.endsWith("right") ? 1 : 0.5;
+ const fy = anchor.startsWith("top") ? 0 : anchor.startsWith("bottom") ? 1 : 0.5;
+ return [fx, fy];
+}
+
+/** Reads a stored anchor, falling back to the free `{ cx, cy }` position older builds stored. */
+export function readWebcamAnchor(anchor: unknown, legacyPosition: unknown): WebcamAnchor {
+ if (isWebcamAnchor(anchor)) return anchor;
+ const p = legacyPosition as { cx?: unknown; cy?: unknown } | null | undefined;
+ if (p && typeof p.cx === "number" && typeof p.cy === "number") {
+ return webcamAnchorAt(p.cx, p.cy);
+ }
+ return "bottom-right";
+}
+
+/** The camera's proportions. Its roundness is a setting of its own, `webcamRoundness`. */
+export type WebcamMask = "rectangle" | "square";
+
+/**
+ * The camera's corner rounding, 0 square to 1 fully round, as a fraction of half the camera's
+ * short side. A fraction, so the same value draws the same shape at any size and resolution;
+ * at 1 a square camera is a circle.
+ */
+export const DEFAULT_WEBCAM_ROUNDNESS = 0.3;
+
+/**
+ * The picture-in-picture camera's size, in percent of the frame's short side. Past 35 it
+ * covers the screen it is there to accompany; older builds allowed 50, read back as 35.
+ */
+export const WEBCAM_SIZE_MIN = 10;
+export const WEBCAM_SIZE_MAX = 35;
+
+/**
+ * Reads a stored camera shape and roundness. `circle` and `rounded` were a proportion and a
+ * rounding folded into one value; they split here into the two settings, the way
+ * `readRecordingFrame` splits the old window themes. A stored roundness wins.
+ */
+export function readWebcamMask(
+ shape: unknown,
+ roundness: unknown,
+): { shape: WebcamMask; roundness: number } {
+ const fromShape = shape === "circle" ? 1 : shape === "rounded" ? 0.6 : DEFAULT_WEBCAM_ROUNDNESS;
+ return {
+ shape: shape === "square" || shape === "circle" ? "square" : "rectangle",
+ roundness:
+ typeof roundness === "number" && Number.isFinite(roundness)
+ ? Math.min(1, Math.max(0, roundness))
+ : fromShape,
+ };
+}
+
export interface ProjectAppearanceDefaults {
wallpaper: string;
wallpaperMotion: "none" | "drift" | "aurora" | "waves";
@@ -79,11 +177,14 @@ export interface ProjectAppearanceDefaults {
borderRadius: number;
padding: number;
webcamLayoutPreset: "picture-in-picture" | "vertical-stack" | "dual-frame" | "no-webcam";
- webcamMaskShape: "rectangle" | "circle" | "square" | "rounded";
+ /** The camera's proportions: its own ("rectangle") or cropped square. See `readWebcamMask`. */
+ webcamMaskShape: WebcamMask;
+ /** 0 square corners to 1 fully round. See `DEFAULT_WEBCAM_ROUNDNESS`. */
+ webcamRoundness: number;
webcamMirrored: boolean;
webcamReactiveZoom: boolean;
webcamSizePreset: number;
- webcamPosition: { cx: number; cy: number } | null;
+ webcamAnchor: WebcamAnchor;
webcamBackgroundMode: "none" | "transparent" | "blur" | "custom";
webcamWallpaper: string;
webcamBlurIntensity: number;
@@ -119,10 +220,11 @@ export const DEFAULT_PROJECT_APPEARANCE: ProjectAppearanceDefaults = {
padding: 50,
webcamLayoutPreset: "picture-in-picture",
webcamMaskShape: "rectangle",
+ webcamRoundness: DEFAULT_WEBCAM_ROUNDNESS,
webcamMirrored: false,
webcamReactiveZoom: true,
webcamSizePreset: 25,
- webcamPosition: null,
+ webcamAnchor: "bottom-right",
webcamBackgroundMode: "none",
webcamWallpaper: "/wallpapers/wallpaper1.jpg",
webcamBlurIntensity: 0.5,
diff --git a/src/native/browserShim.presets.test.ts b/src/native/browserShim.presets.test.ts
index fcb720473..f993fde01 100644
--- a/src/native/browserShim.presets.test.ts
+++ b/src/native/browserShim.presets.test.ts
@@ -23,6 +23,7 @@ const APPEARANCE: StylePresetAppearance = {
padding: 50,
webcamLayoutPreset: "picture-in-picture",
webcamMaskShape: "rectangle",
+ webcamRoundness: 0.3,
webcamMirrored: false,
webcamReactiveZoom: true,
webcamSizePreset: 25,
diff --git a/src/native/sceneDescription.test.ts b/src/native/sceneDescription.test.ts
index 184b388ad..0f4377de0 100644
--- a/src/native/sceneDescription.test.ts
+++ b/src/native/sceneDescription.test.ts
@@ -1092,11 +1092,11 @@ describe("buildSceneDescription.settings mapping", () => {
expect(buildSceneDescription(doc).layout.webcamSize).toBeCloseTo(0.334, 5);
});
- it("webcamSize clamps below 10 and above 50", () => {
+ it("webcamSize clamps below 10 and above 35", () => {
const low = makeDoc({ legacyEditor: { webcamSizePreset: 2 } });
const high = makeDoc({ legacyEditor: { webcamSizePreset: 90 } });
expect(buildSceneDescription(low).layout.webcamSize).toBeCloseTo(0.1, 5);
- expect(buildSceneDescription(high).layout.webcamSize).toBeCloseTo(0.5, 5);
+ expect(buildSceneDescription(high).layout.webcamSize).toBeCloseTo(0.35, 5);
});
it("keeps the flat cursor for an older project and carries the 3D cursor switch", () => {
@@ -1141,7 +1141,8 @@ describe("buildSceneDescription.settings mapping", () => {
},
});
const scene = buildSceneDescription(doc);
- expect(scene.layout.webcamShape).toBe("circle");
+ // An old circle is a square camera, fully round.
+ expect(scene.layout.webcamShape).toBe("square");
expect(scene.layout.webcamMirror).toBe(true);
expect(scene.cursor.show).toBe(false);
expect(scene.cursor.autoHide).toBe(true);
@@ -1372,11 +1373,15 @@ describe("buildSceneDescription.settings mapping", () => {
);
});
- it("still honours the shape picker under picture-in-picture", () => {
+ it("still honours the shape and roundness under picture-in-picture", () => {
const scene = buildSceneDescription(
- docWithCamera({ webcamLayoutPreset: "picture-in-picture", webcamMaskShape: "circle" }),
+ docWithCamera({
+ webcamLayoutPreset: "picture-in-picture",
+ webcamMaskShape: "square",
+ webcamRoundness: 1,
+ }),
);
- expect(scene.layout.webcamShape).toBe("circle");
+ expect(scene.layout.webcamShape).toBe("square");
// A circle is a rounded rect whose radius is HALF its (square) box — that exact
// fraction is what makes the native rounded-box SDF draw a disc rather than a
// blob, at any render size.
diff --git a/src/native/sceneDescription.ts b/src/native/sceneDescription.ts
index 9e01e6bc2..83f78fb7a 100644
--- a/src/native/sceneDescription.ts
+++ b/src/native/sceneDescription.ts
@@ -991,8 +991,9 @@ export function buildSceneDescription(
webcamSize: preset === "no-webcam" ? null : camSize,
layoutPreset: preset,
webcamSizePreset: settings.webcamSizePreset,
- webcamPosition: preset === "picture-in-picture" ? settings.webcamPosition : null,
+ webcamAnchor: settings.webcamAnchor,
webcamMaskShape: settings.webcamMaskShape,
+ webcamRoundness: settings.webcamRoundness,
});
};
const toFrameFractions = (r: RenderRect) => ({
@@ -1053,7 +1054,11 @@ export function buildSceneDescription(
// rectangle, whatever shape the user last picked under picture-in-picture.
webcamShape: computedLayout?.webcamRect?.maskShape ?? settings.webcamMaskShape,
webcamMirror: settings.webcamMirrored,
- webcamPosition: settings.webcamPosition,
+ // The centre of the rect the anchor resolved to. Native places the camera from
+ // `webcamRect`; this only keeps the field's meaning for anything that reads it.
+ webcamPosition: webcamRect
+ ? { cx: webcamRect.x + webcamRect.width / 2, cy: webcamRect.y + webcamRect.height / 2 }
+ : null,
// Gated by the preset: the block layouts size their camera off the screen
// box, so it must never shrink mid-zoom (the UI hides the toggle too).
webcamReactiveZoom: resolveWebcamReactiveZoom(
diff --git a/website/docs/editing-timeline.md b/website/docs/editing-timeline.md
index 185cf7394..39eac2f51 100644
--- a/website/docs/editing-timeline.md
+++ b/website/docs/editing-timeline.md
@@ -31,7 +31,7 @@ A floating icon rail sits over the preview. Five facets:
| Facet | What it controls |
|---|---|
| **Composition** | A background section (image, solid color, or gradient behind your recording; upload your own image or pick from presets), then background blur, shadow, motion blur, corner roundness, and padding. Its **Format** row sets the output shape for preview and export: **Auto** (the default for new projects), which wraps the frame around your recording and camera layout with an even padding border, your clips' own shapes under **Original**, plus 16:9, 9:16, 1:1, 4:3, 4:5, 16:10, and 10:16. |
-| **Camera layout** | Webcam composite: picture-in-picture, vertical stack, dual frame, or no webcam. Mirror, "shrink on zoom," camera shape (rectangle/circle/square/rounded), and size. Drag the webcam bubble directly on the canvas to reposition it. |
+| **Camera layout** | Webcam composite: picture-in-picture, vertical stack, dual frame, or no webcam. Mirror and "shrink on zoom." For picture-in-picture: camera shape (rectangle or square), roundness (fully round, a square camera is a circle), size, and position: one of eight spots along the edge, always the same distance from it. Drag the webcam on the canvas and it snaps to the nearest one. |
| **Audio** | The output level, applied the same way in the preview and the export. |
| **Cursor** | Only meaningful for recordings made in the editable cursor mode, on Windows, macOS, or Linux. Show/hide, clip-to-canvas, a strip of cursor themes, and sliders for size, smoothing, motion blur, and click bounce. |
| **Transcript** | The aggregated transcript across every clip, editable — see [Transcript editing](./captions.md#transcript-editing). Its **Captions** button turns captions on, styles them, and translates them — see [Captions & transcript](./captions.md#captions). |
diff --git a/website/docs/guides/product-demo-video.md b/website/docs/guides/product-demo-video.md
index c3b2231cb..7e3ff07fd 100644
--- a/website/docs/guides/product-demo-video.md
+++ b/website/docs/guides/product-demo-video.md
@@ -52,7 +52,7 @@ The webcam is recorded to its own file, so its placement is an editing decision
- **Picture in picture**, **Vertical stack**, **Dual frame**, or **No webcam**.
- For every layout: mirror, and a crop of the camera image.
-- For **Picture in picture** only: **Camera shape** (Rect, Circle, Square or Rounded), a size from 10 to 50% (25% by default), and **Shrink on zoom**, on by default, which makes the camera smaller while a zoom plays so it does not cover the detail. Drag the camera on the canvas to move it.
+- For **Picture in picture** only: **Camera shape** (Rectangle or Square), **Roundness** (at 100% a square camera is a circle), a size from 10 to 35% (25% by default), **Position** (a corner or the middle of an edge, bottom right by default), and **Shrink on zoom**, on by default, which makes the camera smaller while a zoom plays so it does not cover the detail. Drag the camera on the canvas and it snaps to the nearest position.
- **Camera background**: Original, Blur, Cutout or Custom. Cutout removes the background without a green screen, using a segmentation model that runs on your CPU. This section only appears when the segmentation runtime loads on your machine.
For an intro or outro, press `C` to add a **Full Camera** segment: the camera fills the whole frame for that span.
diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/editing-timeline.md b/website/i18n/de/docusaurus-plugin-content-docs/current/editing-timeline.md
index 31a01a0bb..764db1794 100644
--- a/website/i18n/de/docusaurus-plugin-content-docs/current/editing-timeline.md
+++ b/website/i18n/de/docusaurus-plugin-content-docs/current/editing-timeline.md
@@ -31,7 +31,7 @@ Alles Folgende beschreibt den Modus **Edit**: oben eine Vorschau mit anpassbarer
| Tab | Was er steuert |
|---|---|
| **Composition** | Ein Abschnitt für den Hintergrund (Bild, Volltonfarbe oder Verlauf hinter deiner Aufnahme; eigenes Bild hochladen oder eine Vorlage wählen), dann Hintergrundunschärfe, Schatten, Bewegungsunschärfe, Eckenrundung und Innenabstand. Die Zeile **Format** legt die Ausgabeform für Vorschau und Export fest: **Auto** (Standard für neue Projekte), bei dem sich das Bild mit einem gleichmäßigen Innenabstand als Rand um deine Aufnahme und das Webcam-Layout legt, die eigenen Formen deiner Clips unter **Original**, dazu 16:9, 9:16, 1:1, 4:3, 4:5, 16:10 und 10:16. |
-| **Camera layout** | Webcam-Komposition: Bild-im-Bild, vertikal gestapelt, Doppelrahmen oder keine Webcam. Spiegeln, „Shrink on Zoom“, Kameraform (Rechteck/Kreis/Quadrat/abgerundet) und Größe. Zieh die Webcam-Blase direkt auf der Arbeitsfläche, um sie zu verschieben. |
+| **Camera layout** | Webcam-Komposition: Bild-im-Bild, vertikal gestapelt, Doppelrahmen oder keine Webcam. Spiegeln und „Shrink on Zoom“. Für Bild-im-Bild: Kameraform (Rechteck oder Quadrat), Rundung (ganz rund wird eine quadratische Kamera zum Kreis), Größe und Position: einer von acht Plätzen am Rand, immer im gleichen Abstand dazu. Zieh die Webcam auf der Arbeitsfläche, und sie rastet am nächsten Platz ein. |
| **Audio** | Der Ausgabepegel, in Vorschau und Export gleich angewendet. |
| **Cursor** | Nur sinnvoll für Aufnahmen im bearbeitbaren Cursormodus, unter Windows, macOS oder Linux. Ein-/Ausblenden, auf die Arbeitsfläche begrenzen, eine Leiste mit Cursor-Themes und Regler für Größe, Glättung, Bewegungsunschärfe und Klick-Bounce. |
| **Transcript** | Das zusammengeführte Transkript aller Clips, bearbeitbar, siehe [Bearbeitung über das Transkript](./captions.md#transcript-editing). Die Schaltfläche **Captions** darin schaltet Untertitel ein, gestaltet und übersetzt sie, siehe [Untertitel & Transkript](./captions.md#captions). |
diff --git a/website/i18n/de/docusaurus-plugin-content-docs/current/guides/product-demo-video.md b/website/i18n/de/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
index ca63fd0ef..901369fd1 100644
--- a/website/i18n/de/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
+++ b/website/i18n/de/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
@@ -52,7 +52,7 @@ Die Webcam wird in eine eigene Datei aufgenommen. Ihre Platzierung ist also eine
- **Picture in Picture**, **Vertical Stack**, **Dual Frame** oder **No Webcam**.
- Für jedes Layout: Spiegeln und ein Zuschnitt des Kamerabilds.
-- Nur für **Picture in Picture**: **Camera Shape** (Rect, Circle, Square oder Rounded), eine Größe von 10 bis 50 % (standardmäßig 25 %) und **Shrink on Zoom**, standardmäßig an: Es verkleinert die Kamera, während ein Zoom läuft, damit sie das Detail nicht verdeckt. Zieh die Kamera auf der Arbeitsfläche, um sie zu verschieben.
+- Nur für **Picture in Picture**: **Camera Shape** (Rectangle oder Square), **Roundness** (bei 100 % wird eine quadratische Kamera zum Kreis), eine Größe von 10 bis 35 % (standardmäßig 25 %), **Position** (eine Ecke oder die Mitte einer Kante, standardmäßig unten rechts) und **Shrink on Zoom**, standardmäßig an: Es verkleinert die Kamera, während ein Zoom läuft, damit sie das Detail nicht verdeckt. Zieh die Kamera auf der Arbeitsfläche, und sie rastet an der nächsten Position ein.
- **Camera Background**: Original, Blur, Cutout oder Custom. Cutout entfernt den Hintergrund ohne Greenscreen, mit einem Segmentierungsmodell, das auf deiner CPU läuft. Dieser Abschnitt erscheint nur, wenn sich die Segmentierungs-Laufzeit auf deinem Rechner laden lässt.
Für ein Intro oder Outro drückst du `C`, um ein **Full Camera**-Segment hinzuzufügen: Die Kamera füllt in diesem Abschnitt das ganze Bild.
diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/editing-timeline.md b/website/i18n/es/docusaurus-plugin-content-docs/current/editing-timeline.md
index 192c72c68..e877ba629 100644
--- a/website/i18n/es/docusaurus-plugin-content-docs/current/editing-timeline.md
+++ b/website/i18n/es/docusaurus-plugin-content-docs/current/editing-timeline.md
@@ -31,7 +31,7 @@ Sobre la vista previa hay una barra flotante de íconos con cinco paneles:
| Panel | Qué controla |
|---|---|
| **Composición** | Una sección de fondo (imagen, color sólido o degradado detrás de tu grabación; sube tu propia imagen o elige un preajuste) y luego desenfoque de fondo, sombra, desenfoque de movimiento, redondez de las esquinas y relleno. Su fila **Formato** define la forma de salida para la vista previa y la exportación: **Auto** (la predeterminada en los proyectos nuevos), que ajusta el cuadro alrededor de tu grabación y de la disposición de cámara con un borde de relleno uniforme, las formas propias de tus clips en **Original**, más 16:9, 9:16, 1:1, 4:3, 4:5, 16:10 y 10:16. |
-| **Disposición de cámara** | Composición de la cámara web: imagen en imagen, apilado vertical, marco dual o sin cámara. Reflejo, "reducir al ampliar", forma de la cámara (rectángulo/círculo/cuadrado/redondeado) y tamaño. Arrastra la burbuja de la cámara web directamente sobre el lienzo para cambiarla de lugar. |
+| **Disposición de cámara** | Composición de la cámara web: imagen en imagen, apilado vertical, marco dual o sin cámara. Reflejo y "reducir al ampliar". En imagen en imagen: forma de la cámara (rectángulo o cuadrado), redondez (del todo redonda, una cámara cuadrada es un círculo), tamaño y posición: uno de ocho puntos junto al borde, siempre a la misma distancia de él. Arrastra la cámara web sobre el lienzo y se ajusta al punto más cercano. |
| **Audio** | El nivel de salida, que se aplica igual en la vista previa y en la exportación. |
| **Cursor** | Solo tiene sentido en grabaciones hechas en el modo de cursor editable, en Windows, macOS o Linux. Mostrar/ocultar, recortar al lienzo, una tira de temas de cursor y controles deslizantes de tamaño, suavizado, desenfoque de movimiento y rebote al clic. |
| **Transcripción** | La transcripción conjunta de todos los clips, editable: consulta [Edición de la transcripción](./captions.md#transcript-editing). Su botón **Subtítulos** activa los subtítulos, les da estilo y los traduce: consulta [Subtítulos y transcripción](./captions.md#captions). |
diff --git a/website/i18n/es/docusaurus-plugin-content-docs/current/guides/product-demo-video.md b/website/i18n/es/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
index 2446fb40f..76e952848 100644
--- a/website/i18n/es/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
+++ b/website/i18n/es/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
@@ -52,7 +52,7 @@ La cámara web se graba en su propio archivo, así que su ubicación es una deci
- **Imagen en imagen**, **Apilado vertical**, **Marco dual** o **Sin cámara**.
- En todas las disposiciones: reflejo y un encuadre de la imagen de la cámara.
-- Solo en **Imagen en imagen**: **Forma de cámara** (Rect., Círculo, Cuadrado o Redondeado), un tamaño del 10 al 50 % (25 % por defecto) y **Reducir al ampliar**, activado por defecto, que hace más pequeña la cámara mientras se reproduce un zoom para que no tape el detalle. Arrastra la cámara sobre el lienzo para moverla.
+- Solo en **Imagen en imagen**: **Forma de cámara** (Rectángulo o Cuadrado), **Redondez** (al 100 % una cámara cuadrada es un círculo), un tamaño del 10 al 35 % (25 % por defecto), **Posición** (una esquina o el centro de un borde, abajo a la derecha por defecto) y **Reducir al ampliar**, activado por defecto, que hace más pequeña la cámara mientras se reproduce un zoom para que no tape el detalle. Arrastra la cámara sobre el lienzo y se ajusta a la posición más cercana.
- **Fondo de la cámara**: Original, Desenfocado, Recortado o Personalizado. Recortado quita el fondo sin pantalla verde, con un modelo de segmentación que se ejecuta en tu CPU. Esta sección solo aparece cuando el entorno de ejecución de segmentación se carga en tu equipo.
Para una introducción o un cierre, presiona `C` para agregar un segmento de **Cámara a pantalla completa**: la cámara llena todo el cuadro durante ese tramo.
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/editing-timeline.md b/website/i18n/fr/docusaurus-plugin-content-docs/current/editing-timeline.md
index ca9d52e3c..944783e77 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/editing-timeline.md
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/editing-timeline.md
@@ -31,7 +31,7 @@ Une barre d'icônes flottante se superpose à l'aperçu. Elle donne accès à ci
| Onglet | Ce qu'il contrôle |
|---|---|
| **Composition** | Une section d'arrière-plan (image, couleur unie ou dégradé derrière votre enregistrement ; importez votre propre image ou choisissez parmi les préréglages), puis le flou d'arrière-plan, l'ombre, le flou de mouvement, l'arrondi des coins et la marge. Sa ligne **Format** définit la forme de sortie pour l'aperçu et l'export : **Auto** (par défaut pour les nouveaux projets), qui ajuste le cadre autour de votre enregistrement et de la disposition caméra avec une marge égale sur chaque bord, les formes propres à vos clips sous **Original**, plus 16:9, 9:16, 1:1, 4:3, 4:5, 16:10 et 10:16. |
-| **Disposition caméra** | La composition de la webcam : incrustation d'image, empilement vertical, double cadre ou sans webcam. Effet miroir, « réduire au zoom », forme de la caméra (rectangle/cercle/carré/arrondi) et taille. Faites glisser la bulle de la webcam directement sur le canevas pour la déplacer. |
+| **Disposition caméra** | La composition de la webcam : incrustation d'image, empilement vertical, double cadre ou sans webcam. Effet miroir et « réduire au zoom ». En incrustation : forme de la caméra (rectangle ou carré), arrondi (tout à fait ronde, une caméra carrée devient un cercle), taille et position : l'un des huit emplacements le long du bord, toujours à la même distance de celui-ci. Faites glisser la webcam sur le canevas : elle se cale sur l'emplacement le plus proche. |
| **Audio** | Le niveau de sortie, appliqué de la même façon dans l'aperçu et à l'export. |
| **Curseur** | Utile uniquement pour les enregistrements faits en mode curseur éditable, sous Windows, macOS ou Linux. Afficher/masquer, rogner au canevas, une bande de thèmes de curseur, et des glissières pour la taille, le lissage, le flou de mouvement et le rebond au clic. |
| **Transcription** | La transcription agrégée de tous les clips, modifiable : voir [Montage par la transcription](./captions.md#transcript-editing). Son bouton **Sous-titres** active les sous-titres, les met en forme et les traduit : voir [Sous-titres et transcription](./captions.md#captions). |
diff --git a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/product-demo-video.md b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
index 3b94df2a8..62cc53a26 100644
--- a/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
+++ b/website/i18n/fr/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
@@ -52,7 +52,7 @@ La webcam est enregistrée dans son propre fichier : son placement est donc une
- **Incrustation d'image**, **Empilement vertical**, **Double cadre** ou **Sans webcam**.
- Pour toutes les dispositions : miroir, et recadrage de l'image de la caméra.
-- Pour **Incrustation d'image** uniquement : **Forme de la caméra** (Rect., Cercle, Carré ou Arrondi), une taille de 10 à 50 % (25 % par défaut), et **Réduire au zoom**, activé par défaut, qui réduit la caméra pendant un zoom pour qu'elle ne cache pas le détail. Faites glisser la caméra sur le canevas pour la déplacer.
+- Pour **Incrustation d'image** uniquement : **Forme de la caméra** (Rectangle ou Carré), **Arrondi** (à 100 % une caméra carrée devient un cercle), une taille de 10 à 35 % (25 % par défaut), **Position** (un coin ou le milieu d'un bord, en bas à droite par défaut), et **Réduire au zoom**, activé par défaut, qui réduit la caméra pendant un zoom pour qu'elle ne cache pas le détail. Faites glisser la caméra sur le canevas : elle se cale sur la position la plus proche.
- **Arrière-plan de la caméra** : Original, Flouté, Détouré ou Personnalisé. Détouré retire l'arrière-plan sans fond vert, grâce à un modèle de segmentation qui tourne sur votre CPU. Cette section n'apparaît que si le moteur de segmentation se charge sur votre machine.
Pour une introduction ou une conclusion, appuyez sur `C` pour ajouter un segment **Caméra plein écran** : la caméra remplit tout le cadre pendant ce passage.
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/editing-timeline.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/editing-timeline.md
index 383428b97..59cd70681 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/editing-timeline.md
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/editing-timeline.md
@@ -31,7 +31,7 @@ keywords:
| パネル | 設定できる内容 |
|---|---|
| **コンポジション** | 背景のセクション(録画の背景に画像、単色、グラデーションを配置。自分の画像を読み込むか、プリセットから選択)、続いて背景のぼかし、影、モーションブラー、角の丸み、余白。**フォーマット**の行で、プレビューとエクスポートの出力形状を設定します。**自動**(新規プロジェクトの既定)は、録画とカメラレイアウトを均一な余白で囲むようにフレームを合わせます。**元のサイズ**にはクリップ自体の形状が並び、ほかに 16:9、9:16、1:1、4:3、4:5、16:10、10:16 を選べます。 |
-| **カメラレイアウト** | ウェブカメラの合成:ピクチャーインピクチャ、縦並び、デュアルフレーム、Webカメラなし。左右反転、「ズーム時に縮小」、カメラの形状(長方形/円/正方形/角丸)、サイズ。キャンバス上でウェブカメラのバブルを直接ドラッグして、位置を変えられます。 |
+| **カメラレイアウト** | ウェブカメラの合成:ピクチャーインピクチャ、縦並び、デュアルフレーム、Webカメラなし。左右反転と「ズーム時に縮小」。ピクチャーインピクチャでは、カメラの形状(長方形/正方形)、丸み(最大にすると正方形のカメラは円になります)、サイズ、位置(縁に沿った 8 か所のいずれかで、縁からの距離は常に同じ)を設定できます。キャンバス上でウェブカメラをドラッグすると、いちばん近い位置に吸着します。 |
| **オーディオ** | 出力レベル。プレビューとエクスポートに同じように適用されます。 |
| **カーソル** | Windows、macOS、Linux で、編集可能なカーソルのモードで録画した場合にのみ意味があります。表示/非表示、キャンバスへのクリップ、カーソルテーマの一覧、サイズ・スムージング・モーションブラー・クリックバウンスのスライダー。 |
| **文字起こし** | すべてのクリップをまとめた文字起こしで、編集できます([文字起こしの編集](./captions.md#transcript-editing)を参照)。**字幕**ボタンで字幕をオンにし、スタイルを設定し、翻訳できます([字幕と文字起こし](./captions.md#captions)を参照)。 |
diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/product-demo-video.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
index fe5a67036..af78ec306 100644
--- a/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
+++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
@@ -52,7 +52,7 @@ HUD のすべてのコントロールについては、[画面録画](../recordi
- **ピクチャーインピクチャ**、**縦並び**、**デュアルフレーム**、**Webカメラなし**。
- すべてのレイアウトに共通:左右反転と、カメラ映像のクロップ。
-- **ピクチャーインピクチャ**のみ:**カメラの形状**(長方形、円、正方形、角丸)、10〜50% のサイズ(既定は 25%)、既定でオンの**ズーム時に縮小**。ズーム時に縮小は、ズームの再生中にカメラを小さくして、細部を隠さないようにします。カメラはキャンバス上でドラッグして移動できます。
+- **ピクチャーインピクチャ**のみ:**カメラの形状**(長方形、正方形)、**丸み**(100% で正方形のカメラは円になります)、10〜35% のサイズ(既定は 25%)、**位置**(角または辺の中央。既定は右下)、既定でオンの**ズーム時に縮小**。ズーム時に縮小は、ズームの再生中にカメラを小さくして、細部を隠さないようにします。カメラをキャンバス上でドラッグすると、いちばん近い位置に吸着します。
- **カメラ背景**:オリジナル、ぼかし、切り抜き、カスタム。切り抜きは、CPU 上で動くセグメンテーションモデルを使い、グリーンバックなしで背景を取り除きます。このセクションは、お使いのパソコンでセグメンテーションのランタイムを読み込めた場合にのみ表示されます。
イントロやアウトロには、`C` を押して**フルスクリーンカメラ**のセグメントを追加します。その区間では、カメラがフレーム全体を占めます。
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/editing-timeline.md b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/editing-timeline.md
index 11498b95a..9de161c73 100644
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/editing-timeline.md
+++ b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/editing-timeline.md
@@ -31,7 +31,7 @@ Uma barra flutuante de ícones fica sobre a pré-visualização. São cinco abas
| Aba | O que controla |
|---|---|
| **Composição** | Uma seção de fundo (imagem, cor sólida ou gradiente atrás da gravação; envie sua própria imagem ou escolha uma predefinição), depois desfoque do fundo, sombra, desfoque de movimento, arredondamento dos cantos e espaçamento. A linha **Formato** define a proporção de saída da pré-visualização e da exportação: **Auto** (o padrão para projetos novos), que ajusta o quadro em volta da gravação e do layout da câmera com uma borda de espaçamento uniforme, as proporções dos seus clipes em **Original**, além de 16:9, 9:16, 1:1, 4:3, 4:5, 16:10 e 10:16. |
-| **Layout da câmera** | Composição da webcam: picture-in-picture, empilhamento vertical, quadro duplo ou sem webcam. Espelhamento, "encolher ao ampliar", formato da câmera (retângulo/círculo/quadrado/arredondado) e tamanho. Arraste a bolha da webcam direto no canvas para reposicioná-la. |
+| **Layout da câmera** | Composição da webcam: picture-in-picture, empilhamento vertical, quadro duplo ou sem webcam. Espelhamento e "encolher ao ampliar". No picture-in-picture: formato da câmera (retângulo ou quadrado), arredondamento (toda arredondada, uma câmera quadrada vira um círculo), tamanho e posição: um de oito pontos junto à borda, sempre à mesma distância dela. Arraste a webcam no canvas e ela se encaixa no ponto mais próximo. |
| **Áudio** | O nível de saída, aplicado da mesma forma na pré-visualização e na exportação. |
| **Cursor** | Só faz sentido para gravações feitas no modo de cursor editável, no Windows, no macOS ou no Linux. Mostrar/ocultar, recortar à tela, uma faixa de temas de cursor e controles deslizantes de tamanho, suavização, desfoque de movimento e rebote ao clicar. |
| **Transcrição** | A transcrição agregada de todos os clipes, editável — veja [Edição da transcrição](./captions.md#transcript-editing). O botão **Legendas** ativa as legendas, define o estilo delas e as traduz — veja [Legendas e transcrição](./captions.md#captions). |
diff --git a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/guides/product-demo-video.md b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
index 0dd671260..2911a3907 100644
--- a/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
+++ b/website/i18n/pt-BR/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
@@ -52,7 +52,7 @@ A webcam é gravada em um arquivo próprio, então a posição dela é uma decis
- **Picture in Picture**, **Empilhamento Vertical**, **Quadro Duplo** ou **Sem Webcam**.
- Em todos os layouts: espelhamento e um enquadramento da imagem da câmera.
-- Só em **Picture in Picture**: **Formato da Câmera** (Ret., Círculo, Quadrado ou Arredondado), um tamanho de 10 a 50% (25% por padrão) e **Encolher ao ampliar**, ativado por padrão, que deixa a câmera menor enquanto um zoom é exibido, para que ela não cubra o detalhe. Arraste a câmera no canvas para movê-la.
+- Só em **Picture in Picture**: **Formato da Câmera** (Retângulo ou Quadrado), **Arredondamento** (a 100% uma câmera quadrada vira um círculo), um tamanho de 10 a 35% (25% por padrão), **Posição** (um canto ou o meio de uma borda, embaixo à direita por padrão) e **Encolher ao ampliar**, ativado por padrão, que deixa a câmera menor enquanto um zoom é exibido, para que ela não cubra o detalhe. Arraste a câmera no canvas e ela se encaixa na posição mais próxima.
- **Plano de fundo da câmera**: Original, Desfocado, Recorte ou Personalizado. Recorte remove o fundo sem tela verde, usando um modelo de segmentação que roda na sua CPU. Esta seção só aparece quando o runtime de segmentação carrega no seu computador.
Para uma introdução ou um encerramento, pressione `C` para adicionar um segmento de **Câmera em Tela Cheia**: a câmera preenche o quadro inteiro nesse trecho.
diff --git a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/editing-timeline.md b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/editing-timeline.md
index 3876cbf58..b286615a9 100644
--- a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/editing-timeline.md
+++ b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/editing-timeline.md
@@ -31,7 +31,7 @@ keywords:
| 面板 | 控制内容 |
|---|---|
| **画面合成** | 先是背景部分(在录制画面后面放置图片、纯色或渐变;可以上传自己的图片,也可以从预设中选择),然后是背景模糊、阴影、运动模糊、圆角和内边距。其中的**格式**一行设置预览和导出的输出形状:**自动**(新项目的默认值)让画面包住录制内容和摄像头布局,四周留出均匀的内边距;**原始**下列出片段自身的形状,另外还有 16:9、9:16、1:1、4:3、4:5、16:10 和 10:16。 |
-| **摄像头布局** | 摄像头的合成方式:画中画、垂直堆叠、双画框或无摄像头。还有镜像、“缩放时缩小”、摄像头形状(矩形/圆形/正方形/圆角)和大小。直接在画布上拖动摄像头气泡即可调整位置。 |
+| **摄像头布局** | 摄像头的合成方式:画中画、垂直堆叠、双画框或无摄像头。还有镜像和“缩放时缩小”。画中画下可设置摄像头形状(矩形或正方形)、圆角(调到最圆时,正方形摄像头就是圆形)、大小和位置:沿边缘的八个位置之一,与边缘的距离始终相同。在画布上拖动摄像头,它会吸附到最近的位置。 |
| **音频** | 输出电平,在预览和导出中以相同方式应用。 |
| **光标** | 仅对在 Windows、macOS 或 Linux 上以可编辑光标模式录制的内容有意义。包括显示/隐藏、裁剪到画布、一排光标主题,以及大小、平滑、运动模糊和点击弹跳的滑块。 |
| **转录文本** | 汇总所有片段的转录文本,可以编辑,请参阅[编辑转录文本](./captions.md#transcript-editing)。其中的**字幕**按钮用于开启字幕、设置样式和翻译,请参阅[字幕与转录](./captions.md#captions)。 |
diff --git a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/product-demo-video.md b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
index 619a5df5f..8bdc690ef 100644
--- a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
+++ b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
@@ -52,7 +52,7 @@ HUD 的全部控件请参阅[录制](../recording.md)。
- **画中画**、**垂直堆叠**、**双画框**或**无摄像头**。
- 所有布局均可设置:镜像,以及裁剪摄像头画面。
-- 仅限**画中画**:**摄像头形状**(矩形、圆形、正方形或圆角)、10% 到 50% 的大小(默认 25%),以及默认开启的**缩放时缩小**,它会在播放缩放时把摄像头画面变小,以免挡住细节。在画布上拖动摄像头画面即可移动它。
+- 仅限**画中画**:**摄像头形状**(矩形或正方形)、**圆角**(100% 时正方形摄像头就是圆形)、10% 到 35% 的大小(默认 25%)、**位置**(某个角或某条边的中点,默认右下),以及默认开启的**缩放时缩小**,它会在播放缩放时把摄像头画面变小,以免挡住细节。在画布上拖动摄像头画面,它会吸附到最近的位置。
- **摄像头背景**:原画、模糊、抠图或自定义。抠图无需绿幕即可去除背景,使用的是在你的 CPU 上运行的分割模型。只有当分割运行时能在你的电脑上加载时,才会显示这一部分。
如需片头或片尾,按 `C` 添加一个**全屏摄像头**区间:在这段时间内,摄像头画面会占满整个画面。
diff --git a/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/editing-timeline.md b/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/editing-timeline.md
index 46b9feb4c..cc21604c8 100644
--- a/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/editing-timeline.md
+++ b/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/editing-timeline.md
@@ -31,7 +31,7 @@ keywords:
| 面板 | 可控制的內容 |
|---|---|
| **畫面合成** | 背景區塊(在錄影後方放上圖片、純色或漸層;可以上傳自己的圖片或從預設中挑選),接著是背景模糊、陰影、動態模糊、圓角與內邊距。其中的**格式**列會設定預覽與匯出的輸出形狀:**自動**(新專案的預設值)會讓畫面包住錄影與攝影機版面,四周留出均勻的內邊距;**原始**底下列出片段本身的形狀,另外還有 16:9、9:16、1:1、4:3、4:5、16:10 與 10:16。 |
-| **攝影機版面** | 網路攝影機的合成方式:子母畫面、垂直堆疊、雙畫框或無網路攝影機。鏡像、「縮放時縮小」、攝影機形狀(矩形/圓形/正方形/圓角)與大小。直接在畫布上拖曳網路攝影機的泡泡,即可調整位置。 |
+| **攝影機版面** | 網路攝影機的合成方式:子母畫面、垂直堆疊、雙畫框或無網路攝影機。鏡像與「縮放時縮小」。子母畫面下可設定攝影機形狀(矩形或正方形)、圓角(調到最圓時,正方形攝影機就是圓形)、大小與位置:沿邊緣的八個位置之一,與邊緣的距離始終相同。在畫布上拖曳網路攝影機,它會吸附到最近的位置。 |
| **音訊** | 輸出音量,在預覽與匯出中以相同方式套用。 |
| **游標** | 只對在 Windows、macOS 或 Linux 上以可編輯游標模式錄製的錄影有意義。顯示/隱藏、裁切至畫布、一排游標主題,以及大小、平滑、動態模糊與點擊彈跳的滑桿。 |
| **逐字稿** | 彙整所有片段的逐字稿,可以直接編輯,請參閱[逐字稿編輯](./captions.md#transcript-editing)。其中的**字幕**按鈕可以開啟字幕、設定樣式並翻譯,請參閱[字幕與逐字稿](./captions.md#captions)。 |
diff --git a/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/guides/product-demo-video.md b/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
index 9cd98d6fe..d6867f863 100644
--- a/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
+++ b/website/i18n/zh-TW/docusaurus-plugin-content-docs/current/guides/product-demo-video.md
@@ -52,7 +52,7 @@ OpenScreen 以 60 fps 為擷取目標,在 Windows 與 macOS 上最高可達 38
- **子母畫面**、**垂直堆疊**、**雙畫框**或**無網路攝影機**。
- 所有版面都可以設定:鏡像,以及裁切攝影機畫面。
-- 僅限**子母畫面**:**攝影機形狀**(矩形、圓形、正方形或圓角)、10% 到 50% 的大小(預設 25%),以及預設開啟的**縮放時縮小**,它會在縮放播放時把攝影機畫面縮小,以免遮住細節。在畫布上拖曳攝影機畫面即可移動位置。
+- 僅限**子母畫面**:**攝影機形狀**(矩形或正方形)、**圓角**(100% 時正方形攝影機就是圓形)、10% 到 35% 的大小(預設 25%)、**位置**(某個角或某條邊的中點,預設右下),以及預設開啟的**縮放時縮小**,它會在縮放播放時把攝影機畫面縮小,以免遮住細節。在畫布上拖曳攝影機畫面,它會吸附到最近的位置。
- **攝影機背景**:原畫、模糊、去背或自訂。去背不需要綠幕就能移除背景,使用的是在你的 CPU 上執行的分割模型。只有在你的電腦能載入分割模型的執行環境時,才會出現這個區塊。
如果要做開場或結尾,請按 `C` 加入**全螢幕攝影機**片段:在這段範圍內,攝影機畫面會佔滿整個畫面。