feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR
https://feathersui.com/learn/as3-starling/
Other
915 stars 386 forks source link

ScreenDensityScaleCalculator: Incorrect scale factor on iPad Mini retina in AIR 30+ #1740

Open marpies opened 6 years ago

marpies commented 6 years ago

AIR 30+ now reports DPI of 326 (previously 264) on iPad Mini retina. Due to this, a scale factor of 3 is calculated by ScreenDensityScaleCalculator.

joshtynjala commented 6 years ago

I had noticed that AIR reported an incorrect value for Capabilities.screenDPI. It was convenient that this incorrect value worked well with the existing behavior of ScreenDensityScaleFactorManager. It sounds like Adobe finally fixed it.

It may be tricky to differentiate the iPad Mini from other iPads, but I'll see what I can do.

kevinfoley commented 4 years ago

@joshtynjala Did you determine that this issue cannot be fixed?

joshtynjala commented 4 years ago

I do not have plans to create a special case for it.

kevinfoley commented 4 years ago

Ok, thanks for the info. For anyone else who runs into the same issue, it's fairly straightforward to create a hacky special case:

if (screenDensity == 326) {
    if (_starling.nativeStage.fullScreenWidth == 2048 && _starling.nativeStage.fullScreenHeight == 1536 ||
        _starling.nativeStage.fullScreenWidth == 1536 && _starling.nativeStage.fullScreenHeight == 2048)
    {
        screenDensity = 264;
    }
}
urthling commented 4 years ago

Thank you for highlighting this - I didn't realize this was an issue. So, if just the for the iPad mini:

deviceType aka Capabilities.os

(deviceType.search("iPad4,4") > -1 || deviceType.search("iPad4,5") > -1 || deviceType.search("iPad4,6") > -1)