Comment by crazygringo

4 days ago

Hard disagree. Not having access to true device pixels is a feature, not a bug -- especially when you consider that common screens today range from 90 dpi to 600 dpi. And then not to mention browser zoom on top of that.

Trying to optimize to some kind of perfect pixel alignment shouldn't be a goal anymore. We use antialiasing instead to ensure that widths and weights maintain proportionality no matter what resolution and zoom level you use. Trying to snap to pixels is an anti-feature with modern screens. It made sense when everyone used low-resolution screens and antialiasing wasn't commonly used in OS's and programs. But it hasn't made sense for well over a decade now.

You already have access to device pixels, you just have to calculate it yourself.

Anti-aliasing is not a good solution for orthogonal lines with low device pixel ratios like 1.25 or 1.5. which will be around for a long time. Browsers disagree with you - they don't use anti-aliasing for orthogonal measurements, they round. Which means they do in fact pixel-snap.

I agree that it can be misused like using device pixels for UI, but my suggestions makes the distinction more explicit.

>Trying to optimize to some kind of perfect pixel alignment shouldn't be a goal anymore.

If you're trying to display pixel art (or make games with pixel art), being able to have integral upsizing is very useful. Antialiasing doesn't cut it, and the eye notices when you do non-integral nearest-neighbour upscaling and some pixels are the wrong size.