1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 04:32:57 +08:00

Limit safe area bottom override to iOS only

This commit is contained in:
Dean Herbert 2022-02-04 18:58:29 +09:00
parent 6457cf8d9b
commit 915d63f6de
2 changed files with 13 additions and 1 deletions

View File

@ -89,6 +89,12 @@ namespace osu.Game
}
}
/// <summary>
/// The <see cref="Edges"/> that the game should be drawn over at a top level.
/// Defaults to <see cref="Edges.None"/>.
/// </summary>
public virtual Edges SafeAreaOverrideEdges { get; set; }
protected OsuConfigManager LocalConfig { get; private set; }
protected SessionStatics SessionStatics { get; private set; }
@ -301,7 +307,7 @@ namespace osu.Game
base.Content.Add(new SafeAreaContainer
{
SafeAreaOverrideEdges = Edges.Bottom,
SafeAreaOverrideEdges = SafeAreaOverrideEdges,
RelativeSizeAxes = Axes.Both,
Child = CreateScalingContainer().WithChildren(new Drawable[]
{

View File

@ -3,6 +3,7 @@
using System;
using Foundation;
using osu.Framework.Graphics;
using osu.Game;
using osu.Game.Updater;
using osu.Game.Utils;
@ -18,6 +19,11 @@ namespace osu.iOS
protected override BatteryInfo CreateBatteryInfo() => new IOSBatteryInfo();
public override Edges SafeAreaOverrideEdges =>
// iOS shows a home indicator at the bottom, and adds a safe area to account for this.
// Because we have the home indicator (mostly) hidden we don't really care about drawing in this region.
Edges.Bottom;
private class IOSBatteryInfo : BatteryInfo
{
public override double ChargeLevel => Battery.ChargeLevel;