Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Fix main window restore if was maximized
Browse files Browse the repository at this point in the history
  • Loading branch information
mafiesto4 committed Dec 18, 2018
1 parent f51c650 commit 588c22c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions FlaxEditor/Modules/WindowsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 588c22c

Please sign in to comment.