Expand description
Live editor preview canvas wiring (AUT-510 / ED.6b).
Replaces the old "Preview renders here." placeholder. Paints the composed
frame (zoom / crop / background / cursor) at the playhead by polling the
editor_preview_frame Tauri command — the same compose the export uses
— and putImageData-ing it into the editor canvas, mirroring
crate::camera_preview’s loop. Two hooks installed once per editor mount:
- an [
Effect] on the project signal that callseditor_ipc::editor_preview_openso the backend (re)builds the compose pipeline + sees each edit; - a
setIntervalpoll (~15 fps) that requests the composed frame at the current playhead and paints it.
Unlike the fixed-size camera preview, the editor frame is the clip’s
dimensions, so the canvas is sized from project.source and the poll
computes the expected byte length per clip (putImageData does not scale).
Constants§
- EDITOR_
PREVIEW_ CANVAS_ ID - Stable DOM id for the editor preview
<canvas>. The poll finds it by id (the canvas element itself is rendered by the editor surface). - EDITOR_
PREVIEW_ POLL_ MS - Repaint cadence (ms) — ~15 fps, matching the camera preview poll.
Functions§
- install_
editor_ preview - Native stub — the editor preview runs only in the wasm webview.