Skip to content

Pixels per inch is wrong on 7/8 Plus phones and minis #12

@fancyham

Description

@fancyham

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions