Refresh paused previews after zoom edits

This commit is contained in:
webadderall
2026-09-12 15:49:08 +10:00
parent 8e2e158165
commit 0c4197d63d
7 changed files with 12 additions and 0 deletions
@@ -40,6 +40,7 @@ function clampPercent(value: number) {
return Math.min(100, Math.max(0, value));
}
/** Render an annotation in preview space with editor drag and resize controls. */
export function AnnotationOverlay({
annotation,
isSelected,
@@ -1252,6 +1252,9 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
useEffect(() => {
zoomRegionsRef.current = zoomRegions;
if (!isPlayingRef.current) {
shouldSnapPausedFrameRef.current = true;
}
}, [zoomRegions]);
useEffect(() => {
@@ -27,6 +27,10 @@ interface VideoEventHandlersParams {
speedRegionsRef: React.MutableRefObject<SpeedRegion[]>;
}
/**
* Bind media events to the preview's presented-frame clock while honoring trim
* and speed regions.
*/
export function createVideoEventHandlers(params: VideoEventHandlersParams) {
const {
video,
+1
View File
@@ -15,6 +15,7 @@ import {
} from "@/components/video-editor/types";
import { drawSquircleOnCanvas } from "@/lib/geometry/squircle";
/** Draw the active caption using the same typography and timing as preview. */
export function renderCaptions(
ctx: CanvasRenderingContext2D,
cues: CaptionCue[],
+1
View File
@@ -1661,6 +1661,7 @@ export class FrameRenderer {
};
}
/** Advance the export camera from the shared scene target at this media time. */
private updateAnimationState(timeMs: number): number {
if (!this.cameraContainer || !this.layoutCache) return 0;
+1
View File
@@ -3343,6 +3343,7 @@ export class FrameRenderer {
}
}
/** Advance the export camera from the shared scene target at this media time. */
private updateAnimationState(timeMs: number): number {
if (!this.cameraContainer || !this.layoutCache) {
return 0;
+1
View File
@@ -2096,6 +2096,7 @@ export class ModernVideoExporter {
);
}
/** Build deterministic per-frame camera transforms for native compositors. */
private getNativeStaticLayoutZoomTelemetry(
layout: ReturnType<typeof computePaddedLayout>,
totalFrames: number,