param canvas param width param height export const adaptDPI = ( canvas , width , height ) => { const dpr = window . devicePixelRatio || 1 ; if ( dpr !== 1 ) { canvas . style . width = `${ width }px` ; canvas . style . height = `${ height }px` ; } canvas . width = width * dpr ; canvas . height = height * dpr ; return dpr ; } ; /**
 * Returns true if device's DPR > 1 (aka HighDPI)
 */ export const isHighDPI = ( ) => ( window . devicePixelRatio || 1 ) > 1 ;