Browse Source

Revert "Merge pull request #5853 from Gillibald/fixes/TextBlockHorizontalAlignment"

This reverts commit cb24755a56.
release/0.10.3 0.10.3
Dan Walmsley 5 years ago
parent
commit
cd98f3f99e
  1. 6
      src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs

6
src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs

@ -166,11 +166,9 @@ namespace Avalonia.Media.TextFormatting
/// <param name="height">The current height.</param> /// <param name="height">The current height.</param>
private static void UpdateBounds(TextLine textLine, ref double width, ref double height) private static void UpdateBounds(TextLine textLine, ref double width, ref double height)
{ {
var lineWidth = textLine.Width + textLine.Start * 2; if (width < textLine.LineMetrics.Size.Width)
if (width < lineWidth)
{ {
width = lineWidth; width = textLine.LineMetrics.Size.Width;
} }
height += textLine.LineMetrics.Size.Height; height += textLine.LineMetrics.Size.Height;

Loading…
Cancel
Save