How the Drawing Whiteboard Works
The whiteboard is a single HTML <canvas> element with two modes that share one backing store. In FREEHAND mode the board is a 960×600 logical bitmap and each pointer, stylus or touch sample is pushed into a points buffer; a pure engine (whiteboardEngine.ts) draws the newest segment as a quadratic-Bézier curve that runs from the midpoint of the previous two points to the midpoint of the latest two, using the point between them as the control handle, so a jagged sampled path becomes a continuously smoothed line without re-drawing the whole stroke each frame. In PIXEL-ART mode the board is instead a tiny gridSize×gridSize bitmap stored at one pixel per cell and displayed scaled up with image smoothing turned OFF. Everything is composited straight onto the canvas in the browser; nothing is uploaded.
- One <canvas> element shared by a freehand and a pixel-art mode
- Freehand board is 960×600 logical pixels; strokes are raster, not vector
- Each freehand segment is a quadratic Bézier through recorded midpoints
- Pixel-art board is gridSize×gridSize at 1px per cell, scaled up unsmoothed
- All drawing happens in the browser — no upload, no server
