1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-21 14:57:09 +00:00

Android Editor: Fix padding for display cutout in fullscreen mode

This commit is contained in:
Anish Kumar
2025-11-17 19:00:37 +05:30
parent ef34c3d534
commit acdace4f00

View File

@@ -392,7 +392,12 @@ class Godot private constructor(val context: Context) {
ViewCompat.setOnApplyWindowInsetsListener(rootView) { v: View, insets: WindowInsetsCompat ->
v.post {
if (useImmersive.get()) {
if (isEditorBuild()) {
val windowInsets = insets.getInsets(WindowInsetsCompat.Type.displayCutout())
v.setPadding(windowInsets.left, windowInsets.top, windowInsets.right, windowInsets.bottom)
} else {
v.setPadding(0, 0, 0, 0)
}
} else {
val windowInsets = insets.getInsets(getInsetType())
v.setPadding(windowInsets.left, windowInsets.top, windowInsets.right, windowInsets.bottom)