From 976c8da83c4ef8419b97a4f68dd534fbc4500319 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 29 Mar 2024 10:02:11 +0800 Subject: [PATCH] style: use the larger size of image in diff view if it has two valid bitmaps --- src/SourceGit/Views/DiffView.axaml.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/SourceGit/Views/DiffView.axaml.cs b/src/SourceGit/Views/DiffView.axaml.cs index 04b4ecf4..642e61e9 100644 --- a/src/SourceGit/Views/DiffView.axaml.cs +++ b/src/SourceGit/Views/DiffView.axaml.cs @@ -110,7 +110,17 @@ namespace SourceGit.Views if (left != null) { - return GetDesiredSize(left.Size, availableSize); + var lSize = GetDesiredSize(left.Size, availableSize); + if (right != null) + { + var rSize = GetDesiredSize(right.Size, availableSize); + if (rSize.Width > lSize.Width) return rSize; + return lSize; + } + else + { + return lSize; + } } else if (right != null) {