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§
- Ruler
Tick - One labeled tick on the ruler.
- Timeline
Ruler Props - Props for the
TimelineRulercomponent. - Timeline
Viewport - 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§
- Timeline
Ruler - 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:SSclock 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.