Skip to content

Commit b7dfb7f

Browse files
Fix #332
1 parent f09644e commit b7dfb7f

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/ImageSharp.Drawing/Processing/RichTextOptions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ public class RichTextOptions : TextOptions
1616
/// <param name="font">The font.</param>
1717
public RichTextOptions(Font font)
1818
: base(font)
19-
{
20-
}
19+
=> this.TextRuns = Array.Empty<RichTextRun>();
2120

2221
/// <summary>
2322
/// Initializes a new instance of the <see cref="RichTextOptions" /> class from properties
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) Six Labors.
2+
// Licensed under the Six Labors Split License.
3+
4+
using SixLabors.Fonts;
5+
using SixLabors.ImageSharp.Drawing.Processing;
6+
7+
namespace SixLabors.ImageSharp.Drawing.Tests.Issues;
8+
9+
public class Issue_332
10+
{
11+
[Fact]
12+
public void CanAccessEmptyRichTextRuns()
13+
{
14+
Font font = TestFontUtilities.GetFont(TestFonts.OpenSans, 70);
15+
RichTextOptions options = new(font);
16+
Assert.Empty(options.TextRuns);
17+
}
18+
}

0 commit comments

Comments
 (0)