Fix some issues rider did not raise

This commit is contained in:
Dean Herbert
2022-11-16 19:42:28 +09:00
parent 63405204eb
commit e9f08ad887
4 changed files with 8 additions and 5 deletions

View File

@@ -46,7 +46,7 @@ namespace osu.Framework.Tests.Containers
{
var unused = new AudioContainer
{
Children = (IReadOnlyList<Drawable>)Activator.CreateInstance(containerType)
Children = (IReadOnlyList<Drawable>)Activator.CreateInstance(containerType)!
};
});
@@ -54,7 +54,7 @@ namespace osu.Framework.Tests.Containers
{
var unused = new AudioContainer();
unused.AddRange((IEnumerable<Drawable>)Activator.CreateInstance(containerType));
unused.AddRange((IEnumerable<Drawable>)Activator.CreateInstance(containerType)!);
});
}
}

View File

@@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using System.Diagnostics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@@ -94,6 +95,8 @@ namespace osu.Framework.Tests.Visual.Graphics
// No depth testing.
renderer.PushDepthInfo(new DepthInfo(false));
Debug.Assert(Children != null);
drawStencil(renderer, Children[1]);
drawBackground(renderer, Children[0]);
@@ -141,7 +144,7 @@ namespace osu.Framework.Tests.Visual.Graphics
renderer.PopStencilInfo();
}
public List<DrawNode> Children { get; set; } = new List<DrawNode>();
public List<DrawNode>? Children { get; set; } = new List<DrawNode>();
public bool AddChildDrawNodes => true;
}

View File

@@ -15,7 +15,7 @@ namespace osu.Framework.Graphics
/// <summary>
/// The child <see cref="DrawNode"/>s to draw.
/// </summary>
List<DrawNode> Children { get; set; }
List<DrawNode>? Children { get; set; }
/// <summary>
/// Whether <see cref="Children"/> should be updated by the parenting <see cref="CompositeDrawable"/>.

View File

@@ -42,7 +42,7 @@ namespace osu.Framework.Graphics
/// <summary>
/// The parent of this drawable in the scene graph.
/// </summary>
CompositeDrawable Parent { get; }
CompositeDrawable? Parent { get; }
/// <summary>
/// Whether this drawable is present for any sort of user-interaction.