Historically, one has simply done a floor() after any calculations, to make sure all coordinates, heights and widths align properly to the pixel boundary.
However, this clearly won't work anymore on the retina display, because 0.5 point is now perfectly valid.
How should coders now code pixel perfect things to make their code properly support both standard and retina displays?
Convert the rect to backing-aligned coordinates. You'll probably be doing this in the view, but windows can do it and screens can do it as well.
You may also need to convert back, since the release notes suggest that the backing coordinate spaces are in pixels, so those spaces will obviously be twice as big on a Retina display. If I had one, I'd test it. If everything looks twice as big when you use the backing coordinates in view space, that means you do need to convert them back to view coordinates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With