Skip to content

Commit

Permalink
New height estimation (proposed in gitextensions#6605 (comment) )
Browse files Browse the repository at this point in the history
Don't know if it solves something...
  • Loading branch information
pmiossec committed Mar 30, 2020
1 parent 29f913b commit a84d4f9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions GitUI/Editor/BlameAuthorMargin.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using GitExtUtils.GitUI;
using ICSharpCode.TextEditor;
using Microsoft.VisualStudio.Threading;
Expand All @@ -18,10 +20,19 @@ public class BlameAuthorMargin : AbstractMargin

public BlameAuthorMargin(TextArea textArea) : base(textArea)
{
_lineHeight = textArea.Font.Height + 1;
_lineHeight = GetFontHeight(textArea.Font);
_backgroundColor = ((SolidBrush)SystemBrushes.Window).Color;
}

private static int GetFontHeight(Font font)
{
var max = Math.Max(
TextRenderer.MeasureText("_", font).Height,
(int)Math.Ceiling(font.GetHeight()));

return max + 1;
}

public void SetAvatars(List<JoinableTask<Image>> avatars)
{
_avatars = avatars.Select(a => ThreadHelper.JoinableTaskFactory.Run(async () => await a)).ToList();
Expand Down

0 comments on commit a84d4f9

Please sign in to comment.