@@ -38,6 +38,8 @@ public override void Render(DrawingContext context)
3838 var typeface = view . CreateTypeface ( ) ;
3939 var underlinePen = new Pen ( Brushes . DarkOrange ) ;
4040 var width = Bounds . Width ;
41+ var lineHeight = view . DefaultLineHeight ;
42+ var pixelHeight = PixelSnapHelpers . GetPixelSize ( view ) . Height ;
4143
4244 foreach ( var line in view . VisualLines )
4345 {
@@ -50,8 +52,8 @@ public override void Render(DrawingContext context)
5052
5153 var info = _editor . BlameData . LineInfos [ lineNumber - 1 ] ;
5254 var x = 0.0 ;
53- var y = line . GetTextLineVisualYPosition ( line . TextLines [ 0 ] , VisualYPosition . TextTop ) - view . VerticalOffset ;
54- if ( ! info . IsFirstInGroup && y > view . DefaultLineHeight * 0.6 )
55+ var y = line . GetTextLineVisualYPosition ( line . TextLines [ 0 ] , VisualYPosition . LineMiddle ) - view . VerticalOffset ;
56+ if ( ! info . IsFirstInGroup && y >= 0 )
5557 continue ;
5658
5759 var shaLink = new FormattedText (
@@ -61,8 +63,10 @@ public override void Render(DrawingContext context)
6163 typeface ,
6264 _editor . FontSize ,
6365 Brushes . DarkOrange ) ;
64- context . DrawText ( shaLink , new Point ( x , y ) ) ;
65- context . DrawLine ( underlinePen , new Point ( x , y + shaLink . Baseline + 2 ) , new Point ( x + shaLink . Width , y + shaLink . Baseline + 2 ) ) ;
66+ var shaLinkTop = y - shaLink . Height * 0.5 ;
67+ var underlineY = PixelSnapHelpers . PixelAlign ( y + shaLink . Height * 0.5 + 0.5 , pixelHeight ) ;
68+ context . DrawText ( shaLink , new Point ( x , shaLinkTop ) ) ;
69+ context . DrawLine ( underlinePen , new Point ( x , underlineY ) , new Point ( x + shaLink . Width , underlineY ) ) ;
6670 x += shaLink . Width + 8 ;
6771
6872 var author = new FormattedText (
@@ -72,7 +76,8 @@ public override void Render(DrawingContext context)
7276 typeface ,
7377 _editor . FontSize ,
7478 _editor . Foreground ) ;
75- context . DrawText ( author , new Point ( x , y ) ) ;
79+ var authorTop = y - author . Height * 0.5 ;
80+ context . DrawText ( author , new Point ( x , authorTop ) ) ;
7681
7782 var time = new FormattedText (
7883 info . Time ,
@@ -81,7 +86,8 @@ public override void Render(DrawingContext context)
8186 typeface ,
8287 _editor . FontSize ,
8388 _editor . Foreground ) ;
84- context . DrawText ( time , new Point ( width - time . Width , y ) ) ;
89+ var timeTop = y - time . Height * 0.5 ;
90+ context . DrawText ( time , new Point ( width - time . Width , timeTop ) ) ;
8591 }
8692 }
8793 }
@@ -150,6 +156,7 @@ protected override void OnPointerMoved(PointerEventArgs e)
150156 {
151157 var pos = e . GetPosition ( this ) ;
152158 var typeface = view . CreateTypeface ( ) ;
159+ var lineHeight = view . DefaultLineHeight ;
153160
154161 foreach ( var line in view . VisualLines )
155162 {
@@ -161,7 +168,7 @@ protected override void OnPointerMoved(PointerEventArgs e)
161168 break ;
162169
163170 var info = _editor . BlameData . LineInfos [ lineNumber - 1 ] ;
164- var y = line . GetTextLineVisualYPosition ( line . TextLines [ 0 ] , VisualYPosition . TextTop ) - view . VerticalOffset ;
171+ var y = line . GetTextLineVisualYPosition ( line . TextLines [ 0 ] , VisualYPosition . LineTop ) - view . VerticalOffset ;
165172 var shaLink = new FormattedText (
166173 info . CommitSHA ,
167174 CultureInfo . CurrentCulture ,
@@ -170,7 +177,7 @@ protected override void OnPointerMoved(PointerEventArgs e)
170177 _editor . FontSize ,
171178 Brushes . DarkOrange ) ;
172179
173- var rect = new Rect ( 0 , y , shaLink . Width , shaLink . Height ) ;
180+ var rect = new Rect ( 0 , y , shaLink . Width , lineHeight ) ;
174181 if ( rect . Contains ( pos ) )
175182 {
176183 Cursor = Cursor . Parse ( "Hand" ) ;
0 commit comments