From e2a74e798aa2610dd77241143f0a853a6e28ab9b Mon Sep 17 00:00:00 2001 From: DismissedLight <1686188646@qq.com> Date: Wed, 9 Oct 2024 12:31:22 +0800 Subject: [PATCH] fix first time open crash --- .../UI/Xaml/View/Window/WebView2/UpdateLogContentProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2/UpdateLogContentProvider.cs b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2/UpdateLogContentProvider.cs index 2ac0129011..7100974721 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2/UpdateLogContentProvider.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2/UpdateLogContentProvider.cs @@ -38,7 +38,7 @@ public RectInt32 InitializePosition(RectInt32 parentRect, double parentDpi) PointInt32 center = parentRect.GetPointInt32(PointInt32Kind.Center); SizeInt32 size = new SizeInt32(640, 800).Scale(parentDpi); RectInt32 target = RectInt32Convert.RectInt32(new(center.X - (size.Width / 2), center.Y - (size.Height / 2)), size); - RectInt32 workArea = DisplayArea.GetFromRect(parentRect, DisplayAreaFallback.None).WorkArea; + RectInt32 workArea = DisplayArea.GetFromRect(parentRect, DisplayAreaFallback.Primary).WorkArea; RectInt32 workAreaShrink = new(workArea.X + 48, workArea.Y + 48, workArea.Width - 96, workArea.Height - 96); if (target.Width > workAreaShrink.Width)