1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-25 18:57:18 +08:00

Apply nullability to ScalingContainer

This commit is contained in:
Dean Herbert 2025-02-14 18:35:43 +09:00
parent 4e043e7cab
commit 248bf43ec9
No known key found for this signature in database

View File

@ -1,9 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -27,17 +24,17 @@ namespace osu.Game.Graphics.Containers
{
internal const float TRANSITION_DURATION = 500;
private Bindable<float> sizeX;
private Bindable<float> sizeY;
private Bindable<float> posX;
private Bindable<float> posY;
private Bindable<bool> applySafeAreaPadding;
private Bindable<float> sizeX = null!;
private Bindable<float> sizeY = null!;
private Bindable<float> posX = null!;
private Bindable<float> posY = null!;
private Bindable<bool> applySafeAreaPadding = null!;
private Bindable<MarginPadding> safeAreaPadding;
private Bindable<MarginPadding> safeAreaPadding = null!;
private readonly ScalingMode? targetMode;
private Bindable<ScalingMode> scalingMode;
private Bindable<ScalingMode> scalingMode = null!;
private readonly Container content;
protected override Container<Drawable> Content => content;
@ -46,9 +43,9 @@ namespace osu.Game.Graphics.Containers
private readonly Container sizableContainer;
private BackgroundScreenStack backgroundStack;
private BackgroundScreenStack? backgroundStack;
private Bindable<float> scalingMenuBackgroundDim;
private Bindable<float> scalingMenuBackgroundDim = null!;
private RectangleF? customRect;
private bool customRectIsRelativePosition;
@ -89,7 +86,8 @@ namespace osu.Game.Graphics.Containers
public partial class ScalingDrawSizePreservingFillContainer : DrawSizePreservingFillContainer
{
private readonly bool applyUIScale;
private Bindable<float> uiScale;
private Bindable<float>? uiScale;
protected float CurrentScale { get; private set; } = 1;
@ -101,8 +99,7 @@ namespace osu.Game.Graphics.Containers
}
[Resolved(canBeNull: true)]
[CanBeNull]
private OsuGame game { get; set; }
private OsuGame? game { get; set; }
[BackgroundDependencyLoader]
private void load(OsuConfigManager osuConfig)
@ -240,13 +237,13 @@ namespace osu.Game.Graphics.Containers
private partial class SizeableAlwaysInputContainer : Container
{
[Resolved]
private GameHost host { get; set; }
private GameHost host { get; set; } = null!;
[Resolved]
private ISafeArea safeArea { get; set; }
private ISafeArea safeArea { get; set; } = null!;
[Resolved]
private OsuConfigManager config { get; set; }
private OsuConfigManager config { get; set; } = null!;
private readonly bool confineHostCursor;
private readonly LayoutValue cursorRectCache = new LayoutValue(Invalidation.RequiredParentSizeToFit);