mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 12:50:52 +00:00
Fixed a crash that happened when the script window is opened but minimized, the script has syntax errors, and then the map is saved. Fixes #402.
This commit is contained in:
parent
684e366248
commit
f15c0e0eb1
1 changed files with 22 additions and 0 deletions
|
@ -35,6 +35,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
private int storedpanel1minsize;
|
||||
private int storedpanel2minsize;
|
||||
private int storedsplitterdistance;
|
||||
private int storedheight;
|
||||
private int storedwidth;
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -99,6 +101,26 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
|
||||
#region ================== Event Handlers
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
base.OnResize(e);
|
||||
|
||||
// When the window gets minimized the width and height of the control gets set to 0. That causes problems
|
||||
// when the SplitterDistance is set in this state. So store the width and height and set them even when
|
||||
// the window gets minimized. See https://github.com/jewalky/UltimateDoomBuilder/issues/402
|
||||
if (this.Height != 0)
|
||||
{
|
||||
storedheight = this.Height;
|
||||
storedwidth = this.Width;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Height = storedheight;
|
||||
this.Width = storedwidth;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs e)
|
||||
{
|
||||
// if the hider control isn't hot, let the base resize action occur
|
||||
|
|
Loading…
Reference in a new issue