revert(zoom): drop selected-zoom preview override, preview the current frame

The a686fa0 override replaced findDominantRegion's resolved region with the
raw stored region (forcing strength=1 / transition=null). findDominantRegion
already resolves focus via getResolvedFocus — for focusMode:"auto" it
interpolates the cursor-followed focus from telemetry and applies clamp/blend/
transition. The override bypassed all of that, so previewing an auto-focus
zoom showed a stale static focus and an instant un-eased zoom that did not
match real playback/export.

Hold-to-preview now shows the natural zoom for the current playhead frame
(true before/after compare). The isPreviewingZoom flag is kept — it only
disables the un-zoomed editing guard so findDominantRegion's result is shown.
Previewing while the playhead is outside any zoom shows no zoom by design.
This commit is contained in:
auberginewly
2026-05-19 11:08:54 +08:00
parent a686fa012a
commit b25c2c8363
+1 -18
View File
@@ -59,8 +59,6 @@ import {
DEFAULT_CURSOR_SIZE,
DEFAULT_CURSOR_SMOOTHING,
DEFAULT_ROTATION_3D,
getRotation3D,
getZoomScale,
isRotation3DIdentity,
lerpRotation3D,
rotation3DPerspective,
@@ -1303,7 +1301,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
let lastTransformIsIdentity = true;
let lastPerspectiveValue = 0;
const ticker = () => {
let { region, strength, blendedScale, rotation3D, transition } = findDominantRegion(
const { region, strength, blendedScale, rotation3D, transition } = findDominantRegion(
zoomRegionsRef.current,
currentTimeRef.current,
{
@@ -1312,21 +1310,6 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
},
);
// While holding Preview, show the SELECTED zoom (what the settings panel
// is editing) at full strength, independent of the playhead — otherwise
// the preview reflects whatever region sits at currentTime, which may be
// none or a different zoom when the playhead isn't inside the selection.
if (isPreviewingZoomRef.current && selectedZoomIdRef.current) {
const sel = zoomRegionsRef.current.find((r) => r.id === selectedZoomIdRef.current);
if (sel) {
region = sel;
strength = 1;
blendedScale = getZoomScale(sel);
rotation3D = getRotation3D(sel);
transition = null;
}
}
const defaultFocus = DEFAULT_FOCUS;
let targetScaleFactor = 1;
let targetFocus = defaultFocus;