From af975688196907b0068002c05b83452f1142e0ac Mon Sep 17 00:00:00 2001 From: Dariusz Komosinski Date: Thu, 3 Feb 2022 12:56:40 +0100 Subject: [PATCH 1/2] Text can be nullable. --- src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs b/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs index f01ef886f7..85c2e4eb64 100644 --- a/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs +++ b/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs @@ -35,7 +35,7 @@ namespace Avalonia.Media.TextFormatting /// The maximum number of text lines. /// The text style overrides. public TextLayout( - string text, + string? text, Typeface typeface, double fontSize, IBrush foreground, From 361bfeb1a09b0ac2c02da71fd2a457ffbdd9e6fe Mon Sep 17 00:00:00 2001 From: Dariusz Komosinski Date: Thu, 3 Feb 2022 13:27:09 +0100 Subject: [PATCH 2/2] Foreground can be nullable as well. --- src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs b/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs index 85c2e4eb64..e3b14a5ac3 100644 --- a/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs +++ b/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs @@ -38,7 +38,7 @@ namespace Avalonia.Media.TextFormatting string? text, Typeface typeface, double fontSize, - IBrush foreground, + IBrush? foreground, TextAlignment textAlignment = TextAlignment.Left, TextWrapping textWrapping = TextWrapping.NoWrap, TextTrimming textTrimming = TextTrimming.None, @@ -478,7 +478,7 @@ namespace Avalonia.Media.TextFormatting /// The height of each line of text. /// private static TextParagraphProperties CreateTextParagraphProperties(Typeface typeface, double fontSize, - IBrush foreground, TextAlignment textAlignment, TextWrapping textWrapping, + IBrush? foreground, TextAlignment textAlignment, TextWrapping textWrapping, TextDecorationCollection? textDecorations, FlowDirection flowDirection, double lineHeight) { var textRunStyle = new GenericTextRunProperties(typeface, fontSize, textDecorations, foreground);