fix(cursor): default canvas clipping off

This commit is contained in:
Etienne Lescot
2026-05-18 12:38:40 +02:00
parent 8516707880
commit 788b0a2e9f
4 changed files with 7 additions and 8 deletions
@@ -439,7 +439,7 @@ export function SettingsPanel({
onCursorMotionBlurChange,
cursorClickBounce = 2.5,
onCursorClickBounceChange,
cursorClipToBounds = true,
cursorClipToBounds = false,
onCursorClipToBoundsChange,
hasCursorData = false,
showCursorSettings = true,
@@ -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,
) => {
+3 -3
View File
@@ -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 {
+2 -3
View File
@@ -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) {