Browse Source

switch constructor and field back to array

pull/234/head
Scott Williams 9 years ago
parent
commit
86279d7c3a
  1. 8
      src/ImageSharp.Drawing/Pens/Pen{TPixel}.cs

8
src/ImageSharp.Drawing/Pens/Pen{TPixel}.cs

@ -27,8 +27,8 @@ namespace ImageSharp.Drawing.Pens
public class Pen<TPixel> : IPen<TPixel> public class Pen<TPixel> : IPen<TPixel>
where TPixel : struct, IPixel<TPixel> where TPixel : struct, IPixel<TPixel>
{ {
private static readonly ReadOnlySpan<float> EmptyPattern = new float[0]; private static readonly float[] EmptyPattern = new float[0];
private readonly ReadOnlySpan<float> pattern; private readonly float[] pattern;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ImageSharp.Drawing.Pens.Pen{TPixel}"/> class. /// Initializes a new instance of the <see cref="ImageSharp.Drawing.Pens.Pen{TPixel}"/> class.
@ -36,7 +36,7 @@ namespace ImageSharp.Drawing.Pens
/// <param name="color">The color.</param> /// <param name="color">The color.</param>
/// <param name="width">The width.</param> /// <param name="width">The width.</param>
/// <param name="pattern">The pattern.</param> /// <param name="pattern">The pattern.</param>
public Pen(TPixel color, float width, ReadOnlySpan<float> pattern) public Pen(TPixel color, float width, float[] pattern)
: this(new SolidBrush<TPixel>(color), width, pattern) : this(new SolidBrush<TPixel>(color), width, pattern)
{ {
} }
@ -47,7 +47,7 @@ namespace ImageSharp.Drawing.Pens
/// <param name="brush">The brush.</param> /// <param name="brush">The brush.</param>
/// <param name="width">The width.</param> /// <param name="width">The width.</param>
/// <param name="pattern">The pattern.</param> /// <param name="pattern">The pattern.</param>
public Pen(IBrush<TPixel> brush, float width, ReadOnlySpan<float> pattern) public Pen(IBrush<TPixel> brush, float width, float[] pattern)
{ {
this.StrokeFill = brush; this.StrokeFill = brush;
this.StrokeWidth = width; this.StrokeWidth = width;

Loading…
Cancel
Save