From 3f42e80a795288a1fbab91448020710aa1dc53c1 Mon Sep 17 00:00:00 2001 From: Martin Garstenauer Date: Fri, 9 Jun 2023 13:00:36 +0200 Subject: [PATCH] Fix: Column ruler behind current line highlight. --- .../Rendering/CurrentLineHighlightRenderer.cs | 2 +- src/AvaloniaEdit/Rendering/TextView.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/AvaloniaEdit/Rendering/CurrentLineHighlightRenderer.cs b/src/AvaloniaEdit/Rendering/CurrentLineHighlightRenderer.cs index 243ba8f3..1d193be9 100644 --- a/src/AvaloniaEdit/Rendering/CurrentLineHighlightRenderer.cs +++ b/src/AvaloniaEdit/Rendering/CurrentLineHighlightRenderer.cs @@ -47,7 +47,7 @@ public int Line { } } - public KnownLayer Layer => KnownLayer.Selection; + public KnownLayer Layer => KnownLayer.Background; public IBrush BackgroundBrush { get; set; diff --git a/src/AvaloniaEdit/Rendering/TextView.cs b/src/AvaloniaEdit/Rendering/TextView.cs index 932750fa..cbabc835 100644 --- a/src/AvaloniaEdit/Rendering/TextView.cs +++ b/src/AvaloniaEdit/Rendering/TextView.cs @@ -66,7 +66,7 @@ static TextView() } private readonly ColumnRulerRenderer _columnRulerRenderer; - private readonly CurrentLineHighlightRenderer _currentLineHighlighRenderer; + private readonly CurrentLineHighlightRenderer _currentLineHightlighRenderer; /// /// Creates a new TextView instance. @@ -79,8 +79,8 @@ public TextView() _elementGenerators = new ObserveAddRemoveCollection(ElementGenerator_Added, ElementGenerator_Removed); _lineTransformers = new ObserveAddRemoveCollection(LineTransformer_Added, LineTransformer_Removed); _backgroundRenderers = new ObserveAddRemoveCollection(BackgroundRenderer_Added, BackgroundRenderer_Removed); + _currentLineHightlighRenderer = new CurrentLineHighlightRenderer(this); _columnRulerRenderer = new ColumnRulerRenderer(this); - _currentLineHighlighRenderer = new CurrentLineHighlightRenderer(this); Options = new TextEditorOptions(); Debug.Assert(_singleCharacterElementGenerator != null); // assert that the option change created the builtin element generators @@ -1929,11 +1929,11 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang } if (change.Property == CurrentLineBorderProperty) { - _currentLineHighlighRenderer.BorderPen = CurrentLineBorder; + _currentLineHightlighRenderer.BorderPen = CurrentLineBorder; } if (change.Property == CurrentLineBackgroundProperty) { - _currentLineHighlighRenderer.BackgroundBrush = CurrentLineBackground; + _currentLineHightlighRenderer.BackgroundBrush = CurrentLineBackground; } } @@ -2028,8 +2028,8 @@ public IPen CurrentLineBorder /// public int HighlightedLine { - get => _currentLineHighlighRenderer.Line; - set => _currentLineHighlighRenderer.Line = value; + get => _currentLineHightlighRenderer.Line; + set => _currentLineHightlighRenderer.Line = value; } ///