fix(cursor): default canvas clipping off
This commit is contained in:
@@ -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,
|
||||
) => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user