From 37c2d0afb9b4b878aa2383b0c3f5d6ccdc56ed4d Mon Sep 17 00:00:00 2001 From: Andrey Kunchev Date: Mon, 5 Oct 2020 20:15:27 +0300 Subject: [PATCH] possible fix for #4806 for text formatting with wrap --- .../Media/TextFormatting/TextFormatterImpl.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Avalonia.Visuals/Media/TextFormatting/TextFormatterImpl.cs b/src/Avalonia.Visuals/Media/TextFormatting/TextFormatterImpl.cs index 3e85f0f6f0..7e31d7e6ee 100644 --- a/src/Avalonia.Visuals/Media/TextFormatting/TextFormatterImpl.cs +++ b/src/Avalonia.Visuals/Media/TextFormatting/TextFormatterImpl.cs @@ -391,6 +391,10 @@ namespace Avalonia.Media.TextFormatting measuredLength = currentBreakPosition + lineBreaker.Current.PositionWrap; } } + else if (measuredLength == 0 && currentLength == 0) + { + measuredLength = 1; + } } currentLength += measuredLength;