Skip to content
This repository was archived by the owner on Nov 27, 2019. It is now read-only.

Commit 0ea351d

Browse files
author
joshvera
committed
ceil some line heights
1 parent 992dc62 commit 0ea351d

File tree

1 file changed

+6
-6
lines changed
  • src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering

1 file changed

+6
-6
lines changed

src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,14 +1553,14 @@ void CalculateDefaultTextMetrics()
15531553
new VisualLineTextParagraphProperties { defaultTextRunProperties = textRunProperties },
15541554
null))
15551555
{
1556-
wideSpaceWidth = Math.Max(1, line.WidthIncludingTrailingWhitespace);
1557-
defaultBaseline = Math.Max(1, line.Baseline);
1558-
defaultLineHeight = Math.Max(1, line.Height);
1556+
wideSpaceWidth = Math.Ceiling(Math.Max(1, line.WidthIncludingTrailingWhitespace));
1557+
defaultBaseline = Math.Ceiling(Math.Max(1, line.Baseline));
1558+
defaultLineHeight = Math.Ceiling(Math.Max(1, line.Height));
15591559
}
15601560
} else {
1561-
wideSpaceWidth = FontSize / 2;
1562-
defaultBaseline = FontSize;
1563-
defaultLineHeight = FontSize + 3;
1561+
wideSpaceWidth = Math.Ceiling(FontSize / 2);
1562+
defaultBaseline = Math.Ceiling(FontSize);
1563+
defaultLineHeight = Math.Ceiling(FontSize + 3);
15641564
}
15651565
// Update heightTree.DefaultLineHeight, if a document is loaded.
15661566
if (heightTree != null)

0 commit comments

Comments
 (0)