▲ | chrismorgan 4 days ago | |||||||
“Taking whatever the OS tells them” is rather different! It also gets multiplied by the browser’s zoom, which in both Firefox and Chrome include values like 80%, 90% and 110%. So for me on HN at 120% on my 1.5× laptop display, devicePixelRatio is… 1.8181818181818181. Huh. Wonder why it’s not 1.8. ¯\_(ツ)_/¯ | ||||||||
▲ | brainwad 4 days ago | parent [-] | |||||||
1.8 probably would produce a non-integer number of CSS pixels. The browser needs (wants?) to pick a number that divides both the width and height without remainders. For 1920x1080, 1.8 doesn't (works for the height, but not the width) but 1.8̅1̅ does. | ||||||||
|