News for hackers. Stuff that matters.
Re:It's always been you, Canvas2D by inDigiNeous on Friday March 04, 2022 @03:27PM (#30560046)
Yeah I was struggling with this one a while, seems there is no way to know the actual devicePixelRatio of the display inside a browser, as the browser zoom level directly affects that.

Or does anyone here happen to know a way ?

Re:It's always been you, Canvas2D by moron4hire on Friday March 04, 2022 @07:29PM (#30562521)
DevicePixelRatio and clientWidth/clientHeight change together. You need only the Resize event on the Canvas. Your canvas.clientWidth * window.devicePixelRatio will always be the native width of the canvas.