mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 10:57:45 +08:00
fix: 尝试修复界面启动时的崩溃问题
https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/3481 https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/3480 https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/3479
This commit is contained in:
@@ -29,10 +29,10 @@ namespace MaaWpfGui
|
||||
private readonly int ScreenWidth = int.Parse(ViewStatusStorage.Get("GUI.Monitor.Width", "-1"));
|
||||
private readonly int ScreenHeight = int.Parse(ViewStatusStorage.Get("GUI.Monitor.Height", "-1"));
|
||||
|
||||
private readonly double Left = double.Parse(ViewStatusStorage.Get("GUI.Position.Left", "NaN"));
|
||||
private readonly double Top = double.Parse(ViewStatusStorage.Get("GUI.Position.Top", "NaN"));
|
||||
private readonly double Width = double.Parse(ViewStatusStorage.Get("GUI.Size.Width", "NaN"));
|
||||
private readonly double Height = double.Parse(ViewStatusStorage.Get("GUI.Size.Height", "NaN"));
|
||||
private readonly double Left = double.Parse(ViewStatusStorage.Get("GUI.Position.Left", "-1"));
|
||||
private readonly double Top = double.Parse(ViewStatusStorage.Get("GUI.Position.Top", "-1"));
|
||||
private readonly double Width = double.Parse(ViewStatusStorage.Get("GUI.Size.Width", "-1"));
|
||||
private readonly double Height = double.Parse(ViewStatusStorage.Get("GUI.Size.Height", "-1"));
|
||||
|
||||
private readonly string RootView = "MaaWpfGui.RootView";
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace MaaWpfGui
|
||||
Window window = base.CreateWindow(viewModel, isDialog, ownerViewModel);
|
||||
if (bool.Parse(ViewStatusStorage.Get("GUI.PositionAndSize.Load", bool.TrueString)))
|
||||
{
|
||||
if (isDialog || ownerViewModel != null || double.IsNaN(Left) || double.IsNaN(Top))
|
||||
if (isDialog || ownerViewModel != null || Left == -1 || Top == -1)
|
||||
{
|
||||
return window;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user