From 544469f0785305373b701f70af211f4b787544e8 Mon Sep 17 00:00:00 2001 From: DismissedLight <1686188646@qq.com> Date: Mon, 8 Jul 2024 11:13:38 +0800 Subject: [PATCH] fix webview title text clipping --- .../UI/Xaml/View/Window/WebView2/UpdateLogContentProvider.cs | 2 +- .../UI/Xaml/View/Window/WebView2/WebView2Window.xaml | 4 ++++ 2 files changed, 5 insertions(+), 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 676e4f2c..d88c77f4 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 @@ -25,7 +25,7 @@ internal sealed class UpdateLogContentProvider : IWebView2ContentProvider public RectInt32 InitializePosition(RectInt32 parentRect, double parentDpi) { PointInt32 center = parentRect.GetPointInt32(PointInt32Kind.Center); - SizeInt32 size = new SizeInt32(480, 800).Scale(parentDpi); + 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 workAreaShrink = new(workArea.X + 48, workArea.Y + 48, workArea.Width - 96, workArea.Height - 96); diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2/WebView2Window.xaml b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2/WebView2Window.xaml index 159d066d..323fc6a4 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2/WebView2Window.xaml +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/View/Window/WebView2/WebView2Window.xaml @@ -36,6 +36,10 @@ x:Name="TitleArea" Grid.Column="2" IsHitTestVisible="False"> + + + +