Usage notes
The context contains the current timeline snapshot plus precomputed geometry
so custom layers do not need to call engine hit-test APIs during every draw.
Prefer `visibleClips` and `visibleKeyframes` for dense rendering; use the
full rect arrays only for overlays that truly need offscreen state.
keyframe geometry entries.
Signature
Interface TimelineCanvasLayerDrawContextProperties
| Name | Signature | Description |
|---|---|---|
canvas | canvas: HTMLCanvasElement | App-owned canvas element being drawn. |
clipRects | clipRects: TimelineClipRect<string>[] | All clip rectangles in track order. |
ctx | ctx: CanvasRenderingContext2D | Canvas 2D context scaled to CSS pixels. |
dpr | dpr: number | Current device pixel ratio used for the backing bitmap. |
height | height: number | Canvas height in CSS pixels. |
keyframeRects | keyframeRects: TimelineKeyframeRect<string>[] | All keyframe rectangles in track order. |
reason | reason: TimelineCanvasLayerRenderReason | Reason this draw was scheduled. |
requestDraw | (): void | Schedules another draw, useful after an async asset cache finishes. |
state | state: object | Current timeline state snapshot. |
viewport | viewport: TimelineCanvasLayerViewport | Current viewport metrics. |
visibleClips | visibleClips: VisibleTimelineClip<string>[] | Viewport-intersecting clips in track order. |
visibleKeyframes | visibleKeyframes: VisibleTimelineKeyframe<string>[] | Viewport-intersecting keyframes in track order. |
width | width: number | Canvas width in CSS pixels. |