Skip to main content

Module editor_preview_canvas

Module editor_preview_canvas 

Source
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 calls editor_ipc::editor_preview_open so the backend (re)builds the compose pipeline + sees each edit;
  • a setInterval poll (~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.