From 870427f8d0ad0c559d21337c866aec76dacd9b67 Mon Sep 17 00:00:00 2001 From: Ed Harvey Date: Sat, 10 Dec 2011 18:28:14 +1100 Subject: [PATCH] fit and finish: Add 1 pixel padding to left hand side. --- ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs b/ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs index 41e1d2fb8..770159e1c 100644 --- a/ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs +++ b/ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs @@ -52,7 +52,8 @@ namespace ICSharpCode.ILSpy.AvalonEdit /// protected override Size MeasureOverride(Size availableSize) { - return new Size(18, 0); + // 16px wide icon + 1px each side padding + 1px right-side border + return new Size(19, 0); } protected override void OnRender(DrawingContext drawingContext) @@ -86,13 +87,14 @@ namespace ICSharpCode.ILSpy.AvalonEdit if (!bookmarkDict.TryGetValue(line, out existingBookmark) || bm.ZOrder > existingBookmark.ZOrder) bookmarkDict[line] = bm; } - + + const double imagePadding = 1.0; Size pixelSize = PixelSnapHelpers.GetPixelSize(this); foreach (VisualLine line in textView.VisualLines) { int lineNumber = line.FirstDocumentLine.LineNumber; IBookmark bm; if (bookmarkDict.TryGetValue(lineNumber, out bm)) { - Rect rect = new Rect(0, PixelSnapHelpers.Round(line.VisualTop - textView.VerticalOffset, pixelSize.Height), 16, 16); + Rect rect = new Rect(imagePadding, PixelSnapHelpers.Round(line.VisualTop - textView.VerticalOffset, pixelSize.Height), 16, 16); if (dragDropBookmark == bm && dragStarted) drawingContext.PushOpacity(0.5); drawingContext.DrawImage(bm.Image, rect); @@ -101,7 +103,7 @@ namespace ICSharpCode.ILSpy.AvalonEdit } } if (dragDropBookmark != null && dragStarted) { - Rect rect = new Rect(0, PixelSnapHelpers.Round(dragDropCurrentPoint - 8, pixelSize.Height), 16, 16); + Rect rect = new Rect(imagePadding, PixelSnapHelpers.Round(dragDropCurrentPoint - 8, pixelSize.Height), 16, 16); drawingContext.DrawImage(dragDropBookmark.Image, rect); } }