From 37533cdd04836d08e17b06071bf0b78282b82f7c Mon Sep 17 00:00:00 2001 From: webadderall <131426131+webadderall@users.noreply.github.com> Date: Tue, 2 Jun 2026 20:40:10 +1000 Subject: [PATCH] feat(zoom): use camera physics for handoffs --- .../video-editor/videoPlayback/zoomAnimation.test.ts | 10 +++------- .../video-editor/videoPlayback/zoomRegionUtils.ts | 5 ----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/video-editor/videoPlayback/zoomAnimation.test.ts b/src/components/video-editor/videoPlayback/zoomAnimation.test.ts index 472cf579..b9898859 100644 --- a/src/components/video-editor/videoPlayback/zoomAnimation.test.ts +++ b/src/components/video-editor/videoPlayback/zoomAnimation.test.ts @@ -380,15 +380,11 @@ describe("findDominantRegion", () => { { id: "b", startMs: 3500, endMs: 6000, depth: 3, focus: { cx: 0.8, cy: 0.8 } }, ]; - // During the connected transition (between a.endMs + 200 and a.endMs + 1200) + // During the connected handoff, the next region becomes the spring target. const result = findDominantRegion(regions, 3200, { connectZooms: true }); expect(result.strength).toBe(1); - expect(result.transition).not.toBeNull(); - - // Focus should be blending between the two - if (result.region) { - expect(result.region.focus.cx).toBeGreaterThan(0.2); - } + expect(result.transition).toBeNull(); + expect(result.region?.id).toBe("b"); }); it("keeps the outgoing region active until the connected transition begins", () => { diff --git a/src/components/video-editor/videoPlayback/zoomRegionUtils.ts b/src/components/video-editor/videoPlayback/zoomRegionUtils.ts index 7b01130c..8e1cc6bf 100644 --- a/src/components/video-editor/videoPlayback/zoomRegionUtils.ts +++ b/src/components/video-editor/videoPlayback/zoomRegionUtils.ts @@ -250,11 +250,6 @@ export function findDominantRegion( const connectedPairs = options.connectZooms ? getConnectedRegionPairs(regions) : []; if (options.connectZooms) { - const connectedTransition = getConnectedRegionTransition(connectedPairs, timeMs); - if (connectedTransition) { - return connectedTransition; - } - const connectedHold = getConnectedRegionHold(timeMs, connectedPairs); if (connectedHold) { return { ...connectedHold, transition: null };