CanvasRenderer draws shapes onto an HTML canvas using the Canvas 2D API.
ICanvasRenderer interface
CanvasRenderer
The default implementation. Renders strokes usingperfect-freehand for the draw dash style, and Canvas 2D setLineDash for other styles.
Rendering pipeline
- Apply viewport transform (translate + scale)
- For each visible shape, decode segment paths and render strokes
- For closed shapes with fill, render the fill first, then the stroke
TsdrawRenderTheme
'blue') to hex colors, adapting for the current light/dark theme.