You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically on hidpi/retina screens, the canvas width and height properties need to be multiplied by window.devicePixelRatio (rounded or floored), with CSS pixel values entered as CSS width/height values, otherwise the image will be blurred (linear upscaling, most commonly by a factor of 2 on hidpi / retina screens). Hidpi desktop screens are not super common yet outside of Apple products (although I don't know how anyone can live without them :P), most phones are typically retina/hidpi though, at least as far as web is concerned.
The text was updated successfully, but these errors were encountered:
maciejhirsz
changed the title
Use device pixel ratio
Use window.devicePixelRatio
Jun 18, 2019
Basically on hidpi/retina screens, the canvas
width
andheight
properties need to be multiplied bywindow.devicePixelRatio
(rounded or floored), with CSS pixel values entered as CSS width/height values, otherwise the image will be blurred (linear upscaling, most commonly by a factor of 2 on hidpi / retina screens). Hidpi desktop screens are not super common yet outside of Apple products (although I don't know how anyone can live without them :P), most phones are typically retina/hidpi though, at least as far as web is concerned.The text was updated successfully, but these errors were encountered: