mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-30 22:01:10 +08:00
optimize<HighlightableTextBlock>: using Run instead of TextBlock to improve performance
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
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 TextBlock() {
|
||||
txt.Inlines.Add(new Run() {
|
||||
Background = highlightBrush,
|
||||
LineHeight = txt.LineHeight,
|
||||
Text = txt.Data.Content.Substring(highlight.Start, highlight.Count),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user