Interface

TimelineCanvasLayerDrawContext

Context passed to a custom canvas layer draw callback.

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

Type Definition
Interface TimelineCanvasLayerDrawContext

Properties

NameSignatureDescription
canvascanvas: HTMLCanvasElementApp-owned canvas element being drawn.
clipRectsclipRects: TimelineClipRect<string>[]All clip rectangles in track order.
ctxctx: CanvasRenderingContext2DCanvas 2D context scaled to CSS pixels.
dprdpr: numberCurrent device pixel ratio used for the backing bitmap.
heightheight: numberCanvas height in CSS pixels.
keyframeRectskeyframeRects: TimelineKeyframeRect<string>[]All keyframe rectangles in track order.
reasonreason: TimelineCanvasLayerRenderReasonReason this draw was scheduled.
requestDraw(): voidSchedules another draw, useful after an async asset cache finishes.
statestate: objectCurrent timeline state snapshot.
viewportviewport: TimelineCanvasLayerViewportCurrent viewport metrics.
visibleClipsvisibleClips: VisibleTimelineClip<string>[]Viewport-intersecting clips in track order.
visibleKeyframesvisibleKeyframes: VisibleTimelineKeyframe<string>[]Viewport-intersecting keyframes in track order.
widthwidth: numberCanvas width in CSS pixels.