Skip to content

Commit 3a1e6a3

Browse files
committed
Prevent zero width pens
1 parent 0c2b729 commit 3a1e6a3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • src/ImageSharp.Drawing/Processing

src/ImageSharp.Drawing/Processing/Pen.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Six Labors.
1+
// Copyright (c) Six Labors.
22
// Licensed under the Apache License, Version 2.0.
33

44
using System;
@@ -39,6 +39,8 @@ public Pen(Color color, float width, float[] pattern)
3939
/// <param name="pattern">The pattern.</param>
4040
public Pen(IBrush brush, float width, float[] pattern)
4141
{
42+
Guard.MustBeGreaterThan(width, 0, nameof(width));
43+
4244
this.StrokeFill = brush;
4345
this.StrokeWidth = width;
4446
this.pattern = pattern;

0 commit comments

Comments
 (0)