@mocanvas/mocanvas · function

fitPointsToBox

declare function fitPointsToBox(points: readonly VecLike[], w: number, h: number): VecLike[]

Affinely stretch points so their bounding box becomes exactly [0,w]×[0,h].

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.