mirror of
https://github.com/2dust/v2rayN.git
synced 2026-11-04 19:45:00 +03:00
fix: 修复回归的窗口启动时偏右下偏移 (#9875)
This commit is contained in:
@@ -35,11 +35,16 @@ public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewMode
|
|||||||
|
|
||||||
var width = Math.Min(sizeItem.Width, workingArea.Width / scaling);
|
var width = Math.Min(sizeItem.Width, workingArea.Width / scaling);
|
||||||
var height = Math.Min(sizeItem.Height, workingArea.Height / 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;
|
Width = width;
|
||||||
Height = height;
|
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);
|
Position = new PixelPoint((int)x, (int)y);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
|
|||||||
Reference in New Issue
Block a user