diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-04 21:47:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 21:47:42 +0100 |
commit | 09474ba4c417e7d7c99cac0f9e7871fdac97dcd3 (patch) | |
tree | 1128d070aa03c2f1145bd429e223c22a0abaae89 /platform/iphone/gl_view.mm | |
parent | 056dfa4a70a32e5c43c04341cbc01a33e9ec9ffe (diff) | |
parent | 230510d628affdb33fbbf4ddbc7eef87fd22fdd9 (diff) |
Merge pull request #24151 from endragor/fix-ios-safe-area
Fix iOS safe area insets to use pixels and not points
Diffstat (limited to 'platform/iphone/gl_view.mm')
-rw-r--r-- | platform/iphone/gl_view.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 2925b46007..5b4d1f8226 100644 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -84,7 +84,8 @@ Rect2 _get_ios_window_safe_area(float p_window_width, float p_window_height) { } ERR_FAIL_COND_V(insets.left < 0 || insets.top < 0 || insets.right < 0 || insets.bottom < 0, Rect2(0, 0, p_window_width, p_window_height)); - return Rect2(insets.left, insets.top, p_window_width - insets.right - insets.left, p_window_height - insets.bottom - insets.top); + UIEdgeInsets window_insets = UIEdgeInsetsMake(_points_to_pixels(insets.top), _points_to_pixels(insets.left), _points_to_pixels(insets.bottom), _points_to_pixels(insets.right)); + return Rect2(window_insets.left, window_insets.top, p_window_width - window_insets.right - window_insets.left, p_window_height - window_insets.bottom - window_insets.top); } bool _play_video(String p_path, float p_volume, String p_audio_track, String p_subtitle_track) { |