From 788b0a2e9fb155457d2963ae86544087a1c7ac64 Mon Sep 17 00:00:00 2001 From: Etienne Lescot Date: Mon, 18 May 2026 12:38:40 +0200 Subject: [PATCH] fix(cursor): default canvas clipping off --- src/components/video-editor/SettingsPanel.tsx | 2 +- src/components/video-editor/VideoPlayback.tsx | 2 +- src/components/video-editor/types.ts | 6 +++--- src/lib/exporter/frameRenderer.ts | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx index 5339fcc..1001d4b 100644 --- a/src/components/video-editor/SettingsPanel.tsx +++ b/src/components/video-editor/SettingsPanel.tsx @@ -439,7 +439,7 @@ export function SettingsPanel({ onCursorMotionBlurChange, cursorClickBounce = 2.5, onCursorClickBounceChange, - cursorClipToBounds = true, + cursorClipToBounds = false, onCursorClipToBoundsChange, hasCursorData = false, showCursorSettings = true, diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsx index 9f4f34b..45ca9df 100644 --- a/src/components/video-editor/VideoPlayback.tsx +++ b/src/components/video-editor/VideoPlayback.tsx @@ -269,7 +269,7 @@ const VideoPlayback = forwardRef( cursorSmoothing = DEFAULT_CURSOR_SMOOTHING, cursorMotionBlur = DEFAULT_CURSOR_MOTION_BLUR, cursorClickBounce = DEFAULT_CURSOR_CLICK_BOUNCE, - cursorClipToBounds = true, + cursorClipToBounds = false, }, ref, ) => { diff --git a/src/components/video-editor/types.ts b/src/components/video-editor/types.ts index 614f410..cf426d0 100644 --- a/src/components/video-editor/types.ts +++ b/src/components/video-editor/types.ts @@ -194,9 +194,9 @@ export const DEFAULT_CURSOR_SIZE = 3.0; export const DEFAULT_CURSOR_SMOOTHING = 0.67; export const DEFAULT_CURSOR_MOTION_BLUR = 0.35; export const DEFAULT_CURSOR_CLICK_BOUNCE = 2.5; -// true = clip the native cursor to the video canvas bounds (current behavior); -// false = allow the cursor to overflow into the background. -export const DEFAULT_CURSOR_CLIP_TO_BOUNDS = true; +// false = allow the cursor to overflow into the background by default. +// true = clip the native cursor to the video canvas bounds. +export const DEFAULT_CURSOR_CLIP_TO_BOUNDS = false; export const DEFAULT_ZOOM_MOTION_BLUR = 0.35; export interface TrimRegion { diff --git a/src/lib/exporter/frameRenderer.ts b/src/lib/exporter/frameRenderer.ts index 25693b0..8582158 100644 --- a/src/lib/exporter/frameRenderer.ts +++ b/src/lib/exporter/frameRenderer.ts @@ -611,9 +611,8 @@ export class FrameRenderer { state: this.nativeCursorMotionBlurState, timeMs, }); - // Clip cursor to the actual visible video boundary, accounting for zoom. - // Skip when cursorClipToBounds is off so the cursor can overflow the canvas. - const cursorClip = this.config.cursorClipToBounds === false ? null : this.cameraAwareMaskRect(); + // Clip only when explicitly enabled; by default the cursor may overflow the canvas. + const cursorClip = this.config.cursorClipToBounds === true ? this.cameraAwareMaskRect() : null; this.foregroundCtx.save(); this.foregroundCtx.beginPath(); if (cursorClip) {