From 1bacdc4b6e54b2810b952bb0ccb34f3caa768d80 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sat, 18 Dec 2021 16:33:01 +0100 Subject: [PATCH] Added nullable annotations for DrawEllipse. --- src/Avalonia.Visuals/Media/DrawingContext.cs | 2 +- .../Platform/IDrawingContextImpl.cs | 2 +- .../SceneGraph/DeferredDrawingContextImpl.cs | 2 +- .../Rendering/SceneGraph/EllipseNode.cs | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Avalonia.Visuals/Media/DrawingContext.cs b/src/Avalonia.Visuals/Media/DrawingContext.cs index b55b56817b..a2e3bdc6aa 100644 --- a/src/Avalonia.Visuals/Media/DrawingContext.cs +++ b/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. /// - 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)) { diff --git a/src/Avalonia.Visuals/Platform/IDrawingContextImpl.cs b/src/Avalonia.Visuals/Platform/IDrawingContextImpl.cs index 7e81924a90..a1f42c171c 100644 --- a/src/Avalonia.Visuals/Platform/IDrawingContextImpl.cs +++ b/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. /// - void DrawEllipse(IBrush brush, IPen pen, Rect rect); + void DrawEllipse(IBrush? brush, IPen? pen, Rect rect); /// /// Draws text. diff --git a/src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs b/src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs index 965754c0a6..934d2666b4 100644 --- a/src/Avalonia.Visuals/Rendering/SceneGraph/DeferredDrawingContextImpl.cs +++ b/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(); diff --git a/src/Avalonia.Visuals/Rendering/SceneGraph/EllipseNode.cs b/src/Avalonia.Visuals/Rendering/SceneGraph/EllipseNode.cs index a8c5579a4b..504256b932 100644 --- a/src/Avalonia.Visuals/Rendering/SceneGraph/EllipseNode.cs +++ b/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 childScenes = null) + IDictionary? childScenes = null) : base(rect.Inflate(pen?.Thickness ?? 0), transform) { Transform = transform; @@ -30,12 +30,12 @@ namespace Avalonia.Rendering.SceneGraph /// /// Gets the fill brush. /// - public IBrush Brush { get; } + public IBrush? Brush { get; } /// /// Gets the stroke pen. /// - public ImmutablePen Pen { get; } + public ImmutablePen? Pen { get; } /// /// Gets the transform with which the node will be drawn. @@ -47,9 +47,9 @@ namespace Avalonia.Rendering.SceneGraph /// public Rect Rect { get; } - public override IDictionary ChildScenes { get; } + public override IDictionary? 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) &&