v3.2.4: improved large vs. small cutout detection on Android
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user