@mocanvas/mocanvas · function
declare function traceRoundedRect(ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, radius: number): voidTrace a rectangle with rounded corners.
ctx.roundRect is not in jsdom and was late to Safari, so the path is built
by hand — an overlay that silently stops drawing on one browser is worse than
four arcs.
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.