diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsx index acc3f2e..ea477c8 100644 --- a/src/components/video-editor/VideoPlayback.tsx +++ b/src/components/video-editor/VideoPlayback.tsx @@ -915,22 +915,12 @@ const VideoPlayback = forwardRef( }; const ticker = () => { - const bm = baseMaskRef.current; - const ss = stageSizeRef.current; - const viewportRatio = - bm.width > 0 && bm.height > 0 - ? { - widthRatio: ss.width / bm.width, - heightRatio: ss.height / bm.height, - } - : undefined; const { region, strength, blendedScale, transition } = findDominantRegion( zoomRegionsRef.current, currentTimeRef.current, { connectZooms: true, cursorTelemetry: cursorTelemetryRef.current, - viewportRatio, }, ); diff --git a/src/components/video-editor/videoPlayback/zoomTransform.ts b/src/components/video-editor/videoPlayback/zoomTransform.ts index 61ced66..800949f 100644 --- a/src/components/video-editor/videoPlayback/zoomTransform.ts +++ b/src/components/video-editor/videoPlayback/zoomTransform.ts @@ -90,8 +90,10 @@ export function computeZoomTransform({ } const progress = Math.min(1, Math.max(0, zoomProgress)); - const focusStagePxX = baseMask.x + focusX * baseMask.width; - const focusStagePxY = baseMask.y + focusY * baseMask.height; + // Focus coordinates are stage-normalized (0-1 of full canvas), + // so map directly to stage pixels, not through baseMask. + const focusStagePxX = focusX * stageSize.width; + const focusStagePxY = focusY * stageSize.height; const stageCenterX = stageSize.width / 2; const stageCenterY = stageSize.height / 2; const scale = 1 + (zoomScale - 1) * progress; @@ -128,8 +130,8 @@ export function computeFocusFromTransform({ const focusStagePxY = (stageCenterY - y) / zoomScale; return { - cx: (focusStagePxX - baseMask.x) / baseMask.width, - cy: (focusStagePxY - baseMask.y) / baseMask.height, + cx: focusStagePxX / stageSize.width, + cy: focusStagePxY / stageSize.height, }; } diff --git a/src/lib/exporter/frameRenderer.ts b/src/lib/exporter/frameRenderer.ts index 3c0fd3c..80424b0 100644 --- a/src/lib/exporter/frameRenderer.ts +++ b/src/lib/exporter/frameRenderer.ts @@ -540,16 +540,10 @@ export class FrameRenderer { private updateAnimationState(timeMs: number): number { if (!this.cameraContainer || !this.layoutCache) return 0; - const bmEx = this.layoutCache.maskRect; - const ssEx = this.layoutCache.stageSize; - const viewportRatio = - bmEx.width > 0 && bmEx.height > 0 - ? { widthRatio: ssEx.width / bmEx.width, heightRatio: ssEx.height / bmEx.height } - : undefined; const { region, strength, blendedScale, transition } = findDominantRegion( this.config.zoomRegions, timeMs, - { connectZooms: true, cursorTelemetry: this.config.cursorTelemetry, viewportRatio }, + { connectZooms: true, cursorTelemetry: this.config.cursorTelemetry }, ); const defaultFocus = DEFAULT_FOCUS;