Skip to content

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

fix(cursor): default canvas clipping off

Etienne Lescot788b0a2e9fb1
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index 5339fcc16..1001d4b71 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 9f4f34b1a..45ca9dfd5 100644
--- a/src/components/video-editor/VideoPlayback.tsx
+++ b/src/components/video-editor/VideoPlayback.tsx
@@ -269,7 +269,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
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 614f410bd..cf426d0bc 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 25693b0df..858215815 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) {