Browse Source

Merge pull request #12614 from Gillibald/fixes/textTrimmingWithWrap

Fix TextTrimming in combination with TextWrapping
pull/12637/head
Jumar Macato 3 years ago
committed by GitHub
parent
commit
e02fdfb695
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Avalonia.Base/Media/TextFormatting/TextLineImpl.cs

2
src/Avalonia.Base/Media/TextFormatting/TextLineImpl.cs

@ -1278,7 +1278,7 @@ namespace Avalonia.Media.TextFormatting
var start = GetParagraphOffsetX(width, widthIncludingWhitespace);
var overhangLeading = Math.Max(0, bounds.Left - start);
var overhangTrailing = Math.Max(0, bounds.Width - widthIncludingWhitespace);
var hasOverflowed = overhangLeading + widthIncludingWhitespace + overhangTrailing > _paragraphWidth;
var hasOverflowed = width > _paragraphWidth;
if (!double.IsNaN(lineHeight) && !MathUtilities.IsZero(lineHeight))
{

Loading…
Cancel
Save