-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pixels per inch is wrong on 7/8 Plus phones and minis #12
Comments
Hi @fancyham and thanks for reaching out... Hmm, that is a surprise me. When this was made I used an iPhone 7 Plus myself and as you can see in the example in README.md I got 5.5" in out in diagonal screen dimension 👀. Unfortunately, I have updated my phone to iOS 14 beta so I couldn't test it today. PS. I am familiar with www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions already, but thanks anyway :) What iOS version did you get this on? Cheers! :) |
I think this explains what's going on: The screen is physically ~401 PPI, but internally, it's ~462 PPI. So if you're able to replicate the same issue on your physical device, one solution could be to change the 'return 401' to 'return 462' I can post my code if that's helpful. I suspect Apple was expecting to use a higher-resolution screen but then their display provider couldn't deliver, so they resorted to the downsampling. |
BTW, I wrote to www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions and they replied that they realize the 401 PPI number on their page is misleading but that they don't want to imply that the Plus phones have a higher resolution than the X so currently they'll continue listing the screen's physical PPI rather than what might be called "462 virtual PPI". |
Similar issue is happening with the iPhone 12 and 13 mini. Their screens are actually rendered as if on a larger device, then scaled down by a percentage. In this case, 96%. Drawing a ruler without doing this scaling will yield incorrect measurements. |
PPI number seems to be wrong for iPhone 6, 7, 8 Plus devices, leading to incorrect dimensionInInches, dimensionInCentimeters values, and pixelsPerInch, that don't match up with physical device.
Library returns screen dimensions of:
5.5 x 3.09 inches for the screen
But the actual physical dimensions are:
4.79 × 2.7
There is a 1.15x error.
This seems to be related to the 1/1.15 downsampling unique to these models from the rendered screen buffer to the device's physical screen.
This helps explain the downsampling: https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
(Edit: this link shows the incorrect 401 PPI for drawing to the screen)
So, I think the PPI in this module is calculated using the rendered screen buffer's dimensions (main.nativeBounds.height = 2208, width = 1242), but it should be calculated using device's physical pixels (1920, 1080).
This would be necessary, to do, say a ruler app.
The text was updated successfully, but these errors were encountered: