Browse Source

Only refresh the bracket highlighting when it actually changed. Use same colors as the old editor.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4843 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 17 years ago
parent
commit
a1be8c67f6
  1. 13
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/BracketHighlightRenderer.cs

13
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/BracketHighlightRenderer.cs

@ -18,12 +18,15 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -18,12 +18,15 @@ namespace ICSharpCode.AvalonEdit.AddIn
{
BracketSearchResult result;
Pen borderPen;
Brush backgroundBrush;
TextView textView;
public void SetHighlight(BracketSearchResult result)
{
this.result = result;
textView.InvalidateLayer(this.Layer);
if (this.result != result) {
this.result = result;
textView.InvalidateLayer(this.Layer);
}
}
public BracketHighlightRenderer(TextView textView)
@ -33,6 +36,10 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -33,6 +36,10 @@ namespace ICSharpCode.AvalonEdit.AddIn
this.borderPen = new Pen(Brushes.Blue, 1);
this.borderPen.Freeze();
this.backgroundBrush = new SolidColorBrush(Color.FromArgb(50, 0, 0, 255));
this.backgroundBrush.Freeze();
this.textView = textView;
this.textView.BackgroundRenderers.Add(this);
@ -60,7 +67,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -60,7 +67,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
if (geometry != null) {
geometry.Freeze();
drawingContext.DrawGeometry(Brushes.LightBlue, borderPen, geometry);
drawingContext.DrawGeometry(backgroundBrush, borderPen, geometry);
}
}
}

Loading…
Cancel
Save