pascalpp / FreeRuler

A ruler application for Mac OS X
https://www.pascal.com/freeruler
MIT License
319 stars 25 forks source link

Pixel dimensions aren't accurate #119

Closed CryptoKoa closed 12 months ago

CryptoKoa commented 12 months ago

I've got a 2020 M1 MacBook Air with 13" screen. Apple -> System Settings -> General -> Displays shows my Mac has screen size and resolution of 13.3-inch (2560 × 1600). However, FreeRuler's Pixel units shows something like 1440 x 890. (This is an estimate because the rulers are always offset from the top-left instead of reporting from the screen edge.). Curiously, the Inches unit is spot-on.

pascalpp commented 12 months ago

Yeah that discrepancy is because modern macs have retina screens, with 2x the resolution of previous screens at the same size. But in practice those extra pixels are used to render objects at the same size with more detail, not to render them at twice the size. https://www.macworld.com/article/670709/what-is-a-retina-display.html

So in most of the contexts where one might want to use an onscreen ruler, you want to measure device-independent-pixels, so e.g. an icon that is 32x32 might be rendered with 64 screen pixels in each dimenstion, but it will still show at 32x32 in Free Ruler.

The real-world units such as inches use some internal math to figure out how big an inch is on your screen.