Browse Source

Added nullable annotations for DrawEllipse.

pull/7203/head
Steven Kirk 5 years ago
parent
commit
1bacdc4b6e
  1. 2
      src/Avalonia.Visuals/Media/DrawingContext.cs
  2. 2
      src/Avalonia.Visuals/Platform/IDrawingContextImpl.cs
  3. 2
      src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs
  4. 14
      src/Avalonia.Visuals/Rendering/SceneGraph/EllipseNode.cs

2
src/Avalonia.Visuals/Media/DrawingContext.cs

@ -202,7 +202,7 @@ namespace Avalonia.Media
/// The brush and the pen can both be null. If the brush is null, then no fill is performed.
/// If the pen is null, then no stoke is performed. If both the pen and the brush are null, then the drawing is not visible.
/// </remarks>
public void DrawEllipse(IBrush brush, IPen pen, Point center, double radiusX, double radiusY)
public void DrawEllipse(IBrush? brush, IPen? pen, Point center, double radiusX, double radiusY)
{
if (brush == null && !PenIsVisible(pen))
{

2
src/Avalonia.Visuals/Platform/IDrawingContextImpl.cs

@ -81,7 +81,7 @@ namespace Avalonia.Platform
/// The brush and the pen can both be null. If the brush is null, then no fill is performed.
/// If the pen is null, then no stoke is performed. If both the pen and the brush are null, then the drawing is not visible.
/// </remarks>
void DrawEllipse(IBrush brush, IPen pen, Rect rect);
void DrawEllipse(IBrush? brush, IPen? pen, Rect rect);
/// <summary>
/// Draws text.

2
src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs

@ -176,7 +176,7 @@ namespace Avalonia.Rendering.SceneGraph
}
}
public void DrawEllipse(IBrush brush, IPen pen, Rect rect)
public void DrawEllipse(IBrush? brush, IPen? pen, Rect rect)
{
var next = NextDrawAs<EllipseNode>();

14
src/Avalonia.Visuals/Rendering/SceneGraph/EllipseNode.cs

@ -14,10 +14,10 @@ namespace Avalonia.Rendering.SceneGraph
{
public EllipseNode(
Matrix transform,
IBrush brush,
IPen pen,
IBrush? brush,
IPen? pen,
Rect rect,
IDictionary<IVisual, Scene> childScenes = null)
IDictionary<IVisual, Scene>? childScenes = null)
: base(rect.Inflate(pen?.Thickness ?? 0), transform)
{
Transform = transform;
@ -30,12 +30,12 @@ namespace Avalonia.Rendering.SceneGraph
/// <summary>
/// Gets the fill brush.
/// </summary>
public IBrush Brush { get; }
public IBrush? Brush { get; }
/// <summary>
/// Gets the stroke pen.
/// </summary>
public ImmutablePen Pen { get; }
public ImmutablePen? Pen { get; }
/// <summary>
/// Gets the transform with which the node will be drawn.
@ -47,9 +47,9 @@ namespace Avalonia.Rendering.SceneGraph
/// </summary>
public Rect Rect { get; }
public override IDictionary<IVisual, Scene> ChildScenes { get; }
public override IDictionary<IVisual, Scene>? ChildScenes { get; }
public bool Equals(Matrix transform, IBrush brush, IPen pen, Rect rect)
public bool Equals(Matrix transform, IBrush? brush, IPen? pen, Rect rect)
{
return transform == Transform &&
Equals(brush, Brush) &&

Loading…
Cancel
Save