Skip to content

Commit

Permalink
Fix #332
Browse files Browse the repository at this point in the history
  • Loading branch information
JimBobSquarePants committed Jul 22, 2024
1 parent f09644e commit b7dfb7f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/ImageSharp.Drawing/Processing/RichTextOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ public class RichTextOptions : TextOptions
/// <param name="font">The font.</param>
public RichTextOptions(Font font)
: base(font)
{
}
=> this.TextRuns = Array.Empty<RichTextRun>();

/// <summary>
/// Initializes a new instance of the <see cref="RichTextOptions" /> class from properties
Expand Down
18 changes: 18 additions & 0 deletions tests/ImageSharp.Drawing.Tests/Issues/Issue_332.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.

using SixLabors.Fonts;
using SixLabors.ImageSharp.Drawing.Processing;

namespace SixLabors.ImageSharp.Drawing.Tests.Issues;

public class Issue_332
{
[Fact]
public void CanAccessEmptyRichTextRuns()
{
Font font = TestFontUtilities.GetFont(TestFonts.OpenSans, 70);
RichTextOptions options = new(font);
Assert.Empty(options.TextRuns);
}
}

0 comments on commit b7dfb7f

Please sign in to comment.