Browse Source

Always distribute specified LineHeight evenly (#15481)

pull/15506/head
Benedikt Stebner 2 years ago
committed by GitHub
parent
commit
2e514d7eab
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      src/Avalonia.Base/Media/TextFormatting/TextLineImpl.cs

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

@ -1336,12 +1336,9 @@ namespace Avalonia.Media.TextFormatting
if (!double.IsNaN(lineHeight) && !MathUtilities.IsZero(lineHeight))
{
if (lineHeight < height)
{
var offset = Math.Max(0, height - lineHeight) / 2;
var offset = (height - lineHeight) / 2;
ascent += offset;
}
ascent += offset;
height = lineHeight;
}

Loading…
Cancel
Save