@mocanvas/editor · function

decodeDrawSegmentPath

declare function decodeDrawSegmentPath(path: string): DecodedDrawPoint[] | null

Decode a packed freehand segment path into its points, or null when the blob is not in the layout we understand.

Layout, as observed in the files themselves: base64 of a little-endian buffer holding the first point as three float32 (x, y, pressure) followed by one float16 triple per further point, each a delta from the previous point.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.