v3.2.4: improved large vs. small cutout detection on Android

This commit is contained in:
Evan Debenham
2025-09-05 13:18:13 -04:00
parent 9cf829c694
commit dacac930a5

View File

@@ -91,8 +91,9 @@ public class AndroidPlatformSupport extends PlatformSupport {
int screenSize = Game.width * Game.height; int screenSize = Game.width * Game.height;
for (Rect r : cutout.getBoundingRects()){ for (Rect r : cutout.getBoundingRects()){
int cutoutSize = Math.abs(r.height() * r.width()); int cutoutSize = Math.abs(r.height() * r.width());
//display cutouts are considered large if they take up more than 0.5% of the screen //display cutouts are considered large if they take up more than 0.605% of the screen
if (cutoutSize*200 >= screenSize){ //in reality we want less than about 0.5%, but some cutouts over-report their size
if (cutoutSize*165 >= screenSize){
largeCutout = true; largeCutout = true;
} }
} }