@@ -21,7 +21,7 @@ namespace SixLabors.ImageSharp.Drawing.Processing;
2121/// </remarks>
2222public abstract class Pen : IEquatable < Pen >
2323{
24- private readonly float [ ] ? pattern ;
24+ private readonly float [ ] pattern ;
2525
2626 /// <summary>
2727 /// Initializes a new instance of the <see cref="Pen"/> class.
@@ -50,7 +50,9 @@ protected Pen(Brush strokeFill, float strokeWidth)
5050 /// <param name="strokePattern">The stroke pattern.</param>
5151 protected Pen ( Brush strokeFill , float strokeWidth , float [ ] strokePattern )
5252 {
53+ Guard . NotNull ( strokeFill , nameof ( strokeFill ) ) ;
5354 Guard . MustBeGreaterThan ( strokeWidth , 0 , nameof ( strokeWidth ) ) ;
55+ Guard . NotNull ( strokePattern , nameof ( strokePattern ) ) ;
5456
5557 this . StrokeFill = strokeFill ;
5658 this . StrokeWidth = strokeWidth ;
@@ -115,7 +117,5 @@ public virtual bool Equals(Pen? other)
115117
116118 /// <inheritdoc/>
117119 public override int GetHashCode ( )
118-
119- // TODO: StrokePattern should be part of the hash-code.
120- => HashCode . Combine ( this . StrokeWidth , this . JointStyle , this . EndCapStyle , this . StrokeFill ) ;
120+ => HashCode . Combine ( this . StrokeWidth , this . JointStyle , this . EndCapStyle , this . StrokeFill , this . pattern ) ;
121121}
0 commit comments