http://sidneys77crlfslcr7zmj3msmxchgnxhrxlp3p3kbaswo7twchjnicid.onion/programming/tips/2024/12/02/html5-canvas-tips.html
For example, // a value of `1.5` would indicate that for every CSS pixel, there are 1.5 // device pixels (a scaling ratio of 150%). const ratio = window . devicePixelRatio || 1 ; const canvas = document . getElementById ( ' hidpi-canvas ' ); const ctx = canvas . getContext ( ' 2d ' ); ctx . fillStyle = ' grey ' ; ctx . fillRect ( 0 , 0 , 200 , 200 ); ctx . moveTo ( 50.5 , 105.5 ); ctx . lineTo ( 150.5 , 105.5 ); ctx . strokeStyle = ' black ' ; ctx . stroke (); ctx . font = ' 20pt serif ' ; ctx . fillStyle...