From ddcab649408ac92c8add3befc357cc3f90338cdb Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 28 Aug 2024 13:19:44 +0800 Subject: [PATCH] enhance: do NOT redraw commit graph if vertical scroll of commit list not changed --- src/Views/Histories.axaml.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Views/Histories.axaml.cs b/src/Views/Histories.axaml.cs index f966caaa..e862a07a 100644 --- a/src/Views/Histories.axaml.cs +++ b/src/Views/Histories.axaml.cs @@ -647,7 +647,12 @@ namespace SourceGit.Views private void OnCommitListLayoutUpdated(object _1, EventArgs _2) { - CommitGraph.InvalidateVisual(); + var y = CommitListContainer.Scroll?.Offset.Y ?? 0; + if (y != _lastScrollY) + { + _lastScrollY = y; + CommitGraph.InvalidateVisual(); + } } private void OnCommitListSelectionChanged(object _, SelectionChangedEventArgs e) @@ -695,5 +700,7 @@ namespace SourceGit.Views e.Handled = true; } } + + private double _lastScrollY = 0; } }