Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS.get_window_safe_area() returns incorrect values for iPhone 8 and iPhone X on iOS #55463

Open
MarkusTieche opened this issue Nov 30, 2021 · 1 comment

Comments

@MarkusTieche
Copy link

Godot version

3.4.stable

System information

iPhone

Issue description

Using OS.get_window_safe_area() to rearrange Control-Nodes result in unexpected behaviour on iOs.
Script attached to Control Node:

extends Control

func _ready():
	var SafeArea = OS.get_window_safe_area();
	rect_position.x = SafeArea.position.x;
	rect_position.y = SafeArea.position.y;
	rect_size.x = SafeArea.size.x;
	rect_size.y = SafeArea.size.y;

Tested on physical device in portrait mode.
expected behaviour:
expected

current behaviour:

result

Steps to reproduce

Add script to Control Node:

extends Control

func _ready():
	var SafeArea = OS.get_window_safe_area();
	rect_position.x = SafeArea.position.x;
	rect_position.y = SafeArea.position.y;
	rect_size.x = SafeArea.size.x;
	rect_size.y = SafeArea.size.y;

run on iOs

Minimal reproduction project

No response

@Calinou Calinou changed the title Wrong OS.get_window_safe_area() on iOs OS.get_window_safe_area() returns incorrect values for iPhone 8 and iPhone X on iOS Nov 30, 2021
@Calinou
Copy link
Member

Calinou commented Nov 30, 2021

Related to #49887.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants