Tidy up constructor field initialisation

This commit is contained in:
Dean Herbert 2022-08-26 16:00:20 +09:00
parent 23efec6505
commit a40355186a

View File

@ -14,8 +14,7 @@ namespace osu.Game.Graphics.Containers
/// </summary> /// </summary>
public class UprightAspectMaintainingContainer : Container public class UprightAspectMaintainingContainer : Container
{ {
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content { get; }
private readonly Container content;
/// <summary> /// <summary>
/// Controls how much this container scales compared to its parent (default is 1.0f). /// Controls how much this container scales compared to its parent (default is 1.0f).
@ -27,14 +26,14 @@ namespace osu.Game.Graphics.Containers
/// </summary> /// </summary>
public ScaleMode Scaling { get; set; } = ScaleMode.Vertical; public ScaleMode Scaling { get; set; } = ScaleMode.Vertical;
private readonly LayoutValue layout = new LayoutValue(Invalidation.DrawInfo, InvalidationSource.Parent);
public UprightAspectMaintainingContainer() public UprightAspectMaintainingContainer()
{ {
InternalChild = content = new GrowToFitContainer(); AddInternal(Content = new GrowToFitContainer());
AddLayout(layout); AddLayout(layout);
} }
private readonly LayoutValue layout = new LayoutValue(Invalidation.DrawInfo, InvalidationSource.Parent);
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();