Steven Kirk
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
7 additions and
7 deletions
-
src/Avalonia.Base/Media/DashStyle.cs
-
src/Avalonia.Base/Media/IDashStyle.cs
-
src/Avalonia.Base/Media/Immutable/ImmutableDashStyle.cs
|
|
|
@ -17,8 +17,8 @@ namespace Avalonia.Media |
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="Dashes"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly StyledProperty<AvaloniaList<double>> DashesProperty = |
|
|
|
AvaloniaProperty.Register<DashStyle, AvaloniaList<double>>(nameof(Dashes)); |
|
|
|
public static readonly StyledProperty<AvaloniaList<double>?> DashesProperty = |
|
|
|
AvaloniaProperty.Register<DashStyle, AvaloniaList<double>?>(nameof(Dashes)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="Offset"/> property.
|
|
|
|
@ -83,7 +83,7 @@ namespace Avalonia.Media |
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the length of alternating dashes and gaps.
|
|
|
|
/// </summary>
|
|
|
|
public AvaloniaList<double> Dashes |
|
|
|
public AvaloniaList<double>? Dashes |
|
|
|
{ |
|
|
|
get => GetValue(DashesProperty); |
|
|
|
set => SetValue(DashesProperty, value); |
|
|
|
@ -98,7 +98,7 @@ namespace Avalonia.Media |
|
|
|
set => SetValue(OffsetProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
IReadOnlyList<double> IDashStyle.Dashes => Dashes; |
|
|
|
IReadOnlyList<double>? IDashStyle.Dashes => Dashes; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Raised when the dash style changes.
|
|
|
|
|
|
|
|
@ -12,7 +12,7 @@ namespace Avalonia.Media |
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the length of alternating dashes and gaps.
|
|
|
|
/// </summary>
|
|
|
|
IReadOnlyList<double> Dashes { get; } |
|
|
|
IReadOnlyList<double>? Dashes { get; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets how far in the dash sequence the stroke will start.
|
|
|
|
|
|
|
|
@ -17,7 +17,7 @@ namespace Avalonia.Media.Immutable |
|
|
|
/// </summary>
|
|
|
|
/// <param name="dashes">The dashes collection.</param>
|
|
|
|
/// <param name="offset">The dash sequence offset.</param>
|
|
|
|
public ImmutableDashStyle(IEnumerable<double> dashes, double offset) |
|
|
|
public ImmutableDashStyle(IEnumerable<double>? dashes, double offset) |
|
|
|
{ |
|
|
|
_dashes = dashes?.ToArray() ?? Array.Empty<double>(); |
|
|
|
Offset = offset; |
|
|
|
@ -69,7 +69,7 @@ namespace Avalonia.Media.Immutable |
|
|
|
return hashCode; |
|
|
|
} |
|
|
|
|
|
|
|
private static bool SequenceEqual(IReadOnlyList<double> left, IReadOnlyList<double> right) |
|
|
|
private static bool SequenceEqual(IReadOnlyList<double> left, IReadOnlyList<double>? right) |
|
|
|
{ |
|
|
|
if (ReferenceEquals(left, right)) |
|
|
|
{ |
|
|
|
|