mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
optimize<HighlightableTextBlock>: using Run instead of TextBlock to improve performance
This commit is contained in:
parent
460f8715da
commit
898599afc9
1 changed files with 2 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Documents;
|
using System.Windows.Documents;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
@ -69,9 +69,8 @@ namespace SourceGit.Views.Controls {
|
||||||
txt.Inlines.Add(new Run(txt.Data.Content.Substring(started, highlight.Start - started)));
|
txt.Inlines.Add(new Run(txt.Data.Content.Substring(started, highlight.Start - started)));
|
||||||
}
|
}
|
||||||
|
|
||||||
txt.Inlines.Add(new TextBlock() {
|
txt.Inlines.Add(new Run() {
|
||||||
Background = highlightBrush,
|
Background = highlightBrush,
|
||||||
LineHeight = txt.LineHeight,
|
|
||||||
Text = txt.Data.Content.Substring(highlight.Start, highlight.Count),
|
Text = txt.Data.Content.Substring(highlight.Start, highlight.Count),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue