Browse Source

fit and finish: Add 1 pixel padding to left hand side.

pull/301/head
Ed Harvey 14 years ago
parent
commit
870427f8d0
  1. 10
      ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs

10
ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs

@ -52,7 +52,8 @@ namespace ICSharpCode.ILSpy.AvalonEdit
/// <inheritdoc/> /// <inheritdoc/>
protected override Size MeasureOverride(Size availableSize) 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) protected override void OnRender(DrawingContext drawingContext)
@ -86,13 +87,14 @@ namespace ICSharpCode.ILSpy.AvalonEdit
if (!bookmarkDict.TryGetValue(line, out existingBookmark) || bm.ZOrder > existingBookmark.ZOrder) if (!bookmarkDict.TryGetValue(line, out existingBookmark) || bm.ZOrder > existingBookmark.ZOrder)
bookmarkDict[line] = bm; bookmarkDict[line] = bm;
} }
const double imagePadding = 1.0;
Size pixelSize = PixelSnapHelpers.GetPixelSize(this); Size pixelSize = PixelSnapHelpers.GetPixelSize(this);
foreach (VisualLine line in textView.VisualLines) { foreach (VisualLine line in textView.VisualLines) {
int lineNumber = line.FirstDocumentLine.LineNumber; int lineNumber = line.FirstDocumentLine.LineNumber;
IBookmark bm; IBookmark bm;
if (bookmarkDict.TryGetValue(lineNumber, out 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) if (dragDropBookmark == bm && dragStarted)
drawingContext.PushOpacity(0.5); drawingContext.PushOpacity(0.5);
drawingContext.DrawImage(bm.Image, rect); drawingContext.DrawImage(bm.Image, rect);
@ -101,7 +103,7 @@ namespace ICSharpCode.ILSpy.AvalonEdit
} }
} }
if (dragDropBookmark != null && dragStarted) { 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); drawingContext.DrawImage(dragDropBookmark.Image, rect);
} }
} }

Loading…
Cancel
Save