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. /// 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. /// 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> /// </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)) 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. /// 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. /// 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> /// </remarks>
void DrawEllipse(IBrush brush, IPen pen, Rect rect); void DrawEllipse(IBrush? brush, IPen? pen, Rect rect);
/// <summary> /// <summary>
/// Draws text. /// 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>(); var next = NextDrawAs<EllipseNode>();

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

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

Loading…
Cancel
Save