|
|
|
@ -3,6 +3,7 @@ using Avalonia.Input; |
|
|
|
using Avalonia.Reactive; |
|
|
|
using Avalonia.Media; |
|
|
|
using Avalonia.Media.TextFormatting; |
|
|
|
using System; |
|
|
|
|
|
|
|
namespace Avalonia.Controls.Primitives |
|
|
|
{ |
|
|
|
@ -68,11 +69,15 @@ namespace Avalonia.Controls.Primitives |
|
|
|
if (underscore != -1 && ShowAccessKey) |
|
|
|
{ |
|
|
|
var rect = TextLayout!.HitTestTextPosition(underscore); |
|
|
|
var offset = new Vector(0, -1.5); |
|
|
|
|
|
|
|
var x1 = Math.Round(rect.Left, MidpointRounding.AwayFromZero); |
|
|
|
var x2 = Math.Round(rect.Right, MidpointRounding.AwayFromZero); |
|
|
|
var y = Math.Round(rect.Bottom, MidpointRounding.AwayFromZero) - 1.5; |
|
|
|
|
|
|
|
context.DrawLine( |
|
|
|
new Pen(Foreground, 1), |
|
|
|
rect.BottomLeft + offset, |
|
|
|
rect.BottomRight + offset); |
|
|
|
new Point(x1, y), |
|
|
|
new Point(x2, y)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|