From 588c22cc14b77263d2de2edc58b6313fdf9185a1 Mon Sep 17 00:00:00 2001 From: mafiesto4 Date: Tue, 18 Dec 2018 21:21:49 +0100 Subject: [PATCH] Fix main window restore if was maximized --- FlaxEditor/Modules/WindowsModule.cs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/FlaxEditor/Modules/WindowsModule.cs b/FlaxEditor/Modules/WindowsModule.cs index 8e0ac454..3d80989c 100644 --- a/FlaxEditor/Modules/WindowsModule.cs +++ b/FlaxEditor/Modules/WindowsModule.cs @@ -279,19 +279,23 @@ public bool LoadLayout(string path) if (bounds.X < virtualDesktopSafeLeftCorner.X || bounds.Y < virtualDesktopSafeLeftCorner.Y || bounds.X > virtualDesktopSafeRightCorner.X || bounds.Y > virtualDesktopSafeRightCorner.Y) bounds.Location = virtualDesktopSafeLeftCorner; - if (Mathf.Min(bounds.Size.X, bounds.Size.Y) >= 1) - { - MainWindow.ClientBounds = bounds; - } - else + if (isMaximized) { MainWindow.ClientPosition = bounds.Location; - } - if (isMaximized) - { MainWindow.Maximize(); } + else + { + if (Mathf.Min(bounds.Size.X, bounds.Size.Y) >= 1) + { + MainWindow.ClientBounds = bounds; + } + else + { + MainWindow.ClientPosition = bounds.Location; + } + } } // Load master panel structure