I've created Hi-Res Canvas2D, a wrapper around Canvas2D to make handling HiDPI screen scaling easier.

Tell the wrapper your DPI and use draw functions as normal without * dpr on the end of everything 🙂‍↕️

https://github.com/vcync/hires-canvas2d

https://www.npmjs.com/package/@vcync/hires-canvas2d

#canvas #canvas2d #javascript #canvasrenderingcontext2d

GitHub - vcync/hires-canvas2d: A wrapper around CanvasRenderingContext2D to handle HiDPI scaling

A wrapper around CanvasRenderingContext2D to handle HiDPI scaling - vcync/hires-canvas2d

GitHub