v3.2.5: adjusted iOS dynamic island handling for buff indicator change

This commit is contained in:
Evan Debenham
2025-09-25 12:33:33 -04:00
committed by Evan Debenham
parent d88baaf36f
commit a511156298
2 changed files with 27 additions and 12 deletions

View File

@@ -58,6 +58,30 @@ public class IOSPlatformSupport extends PlatformSupport {
return Gdx.graphics.getSafeInsetBottom() > 0;
}
@Override
public RectF getDisplayCutout() {
int topInset = Gdx.graphics.getSafeInsetTop();
//older device with no cutout, or landscape (we ignore cutouts in this case)
if (topInset == 0){
return new RectF();
}
//magic number BS for larger status bar caused by dynamic island
boolean hasDynamicIsland = topInset / Gdx.graphics.getBackBufferScale() >= 51;
if (!hasDynamicIsland){
//classic notch, just shrink for the oversized safe are and then return all top.
// this is inaccurate, as there's space left and right, but we don't care
return new RectF(0, 0, Game.width, topInset / 1.2f);
} else {
//we estimate dynamic island as being 130x390 px, 35px from top.
// this is mostly accurate, slightly oversized
RectF cutout = new RectF( Game.width/2 - 195, 35, Game.width/2 + 195, 165);
return cutout;
}
}
@Override
public RectF getSafeInsets(int level) {
RectF insets = super.getSafeInsets(INSET_ALL);