From 15ba2bdf931fd6e88c1fff40415fdcbfac574efd Mon Sep 17 00:00:00 2001 From: sparklelcm333 Date: Wed, 5 Aug 2026 10:38:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E7=9A=84=E7=AA=97=E5=8F=A3=E5=90=AF=E5=8A=A8=E6=97=B6=E5=81=8F?= =?UTF-8?q?=E5=8F=B3=E4=B8=8B=E5=81=8F=E7=A7=BB=20(#9875)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2rayN/v2rayN.Desktop/Base/WindowBase.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/v2rayN/v2rayN.Desktop/Base/WindowBase.cs b/v2rayN/v2rayN.Desktop/Base/WindowBase.cs index fe8c32e2..fda48831 100644 --- a/v2rayN/v2rayN.Desktop/Base/WindowBase.cs +++ b/v2rayN/v2rayN.Desktop/Base/WindowBase.cs @@ -35,11 +35,16 @@ public class WindowBase : ReactiveWindow where TViewMode var width = Math.Min(sizeItem.Width, workingArea.Width / scaling); var height = Math.Min(sizeItem.Height, workingArea.Height / scaling); - var x = workingArea.X + ((workingArea.Width - (width * scaling)) / 2); - var y = workingArea.Y + ((workingArea.Height - (height * scaling)) / 2); Width = width; Height = height; + + var frameDiff = (FrameSize ?? ClientSize) - ClientSize; + var totalWidth = (width + frameDiff.Width) * scaling; + var totalHeight = (height + frameDiff.Height) * scaling; + + var x = workingArea.X + ((workingArea.Width - totalWidth) / 2); + var y = workingArea.Y + ((workingArea.Height - totalHeight) / 2); Position = new PixelPoint((int)x, (int)y); } catch { }