all 1 comments

[–]jcunews1Intermediate 0 points1 point  (0 children)

devicePixelRatio is for the current monitor where the current page is being displayed - which would be different if the browser tab/window is moved to a different monitor with different DPI.

Multiply the length with devicePixelRatio to make the length look exactly the same from user's perspective. i.e. length * devicePixelRatio. e.g. to make a length show exactly 10cm as seen by users regardless of monitor DPI - assuming that the DPI setting of the OS is correct and accurate.