I was running into some issues with iPhone 6+ using my current 3.4.8/3.4.9 hybrid. Also, enabling mac (with all the possible resolutions available) and ipad pro.
After some experimentation, I found a working solution that doesn't rely on fractional contentScaleFactor (and all the oddness that leads to). Maybe someone else will find it useful as well:
- Determine the best content scale factor for the device.
- Take the pixel size and divide with the scale factor. Eg. iphone6 landscape with content scale factor 2 would be 667 x 375. This is our rescaled size.
- Get a rescale factor by dividing 568 by rescaled width and 384 by rescaled height (for landscape, switch values for portrait). In this case, values are 0.85157... and 1.024. The smallest value is our rescale factor. In this case 0.85157....
- If the rescale factor is greater or equal to 1.0, then the design size = rescaled size. Otherwise design size is the same as the rescaled size. In our example, design size becomes 568x319.
_winSizeInPoints is set to design size (
_winSizeInPixels keeps the same value)
In this example, we should be rendering 568x319 with 1136x638 pixels but projecting it on 1334x750. Or that is the idea anyway.