Skip to main content

Module timeline_view

Module timeline_view 

Source
Expand description

Timeline coordinate system + ruler (ED.8 / M-EDIT).

TimelineViewport is the pure frame↔pixel mapping — zoom (px_per_frame), scroll (scroll_frame), and “nice” ruler-tick generation — that the whole timeline (ruler, lanes, playhead, snapping) hangs off. It is GPU/DOM-free and exhaustively unit-tested at multiple zoom levels.

TimelineRuler renders a fit-to-width ruler (the full-clip “global progress” view, decoupled from per-lane zoom) with frame-correct tick labels, a reactive playhead, and click-to-seek.

Structs§

RulerTick
One labeled tick on the ruler.
TimelineRulerProps
Props for the TimelineRuler component.
TimelineViewport
Maps between project frames and timeline pixels at a zoom + scroll.

Constants§

MAX_PX_PER_FRAME 🔒
MIN_PX_PER_FRAME 🔒
Zoom bounds, in pixels per frame.
MIN_TICK_SPACING_PX 🔒
Target minimum spacing between ruler tick labels, in pixels.

Functions§

TimelineRuler
A fit-to-width ruler: frame-correct tick labels + a reactive playhead + click-to-seek. Reads the playhead from the editor-status context.
format_clock 🔒
M:SS clock label for a frame.
frames_f64 🔒
nice_second_interval 🔒
Smallest “nice” second interval whose pixel width is at least MIN_TICK_SPACING_PX — so ruler labels never crowd.