Browse Source

Merge pull request #4998 from Gillibald/fixes/TextDecorationLocation

Fix TextDecoration location calculation
pull/5010/head
Benedikt Stebner 6 years ago
committed by GitHub
parent
commit
7ef18ddc52
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/Avalonia.Visuals/Media/TextDecoration.cs

4
src/Avalonia.Visuals/Media/TextDecoration.cs

@ -189,11 +189,11 @@ namespace Avalonia.Media
break;
case TextDecorationLocation.Strikethrough:
origin += new Point(shapedTextCharacters.GlyphRun.BaselineOrigin.X,
shapedTextCharacters.GlyphRun.BaselineOrigin.Y - fontMetrics.StrikethroughPosition);
shapedTextCharacters.GlyphRun.BaselineOrigin.Y + fontMetrics.StrikethroughPosition);
break;
case TextDecorationLocation.Underline:
origin += new Point(shapedTextCharacters.GlyphRun.BaselineOrigin.X,
shapedTextCharacters.GlyphRun.BaselineOrigin.Y - fontMetrics.UnderlinePosition);
shapedTextCharacters.GlyphRun.BaselineOrigin.Y + fontMetrics.UnderlinePosition);
break;
}

Loading…
Cancel
Save