Fixed resource options dialog being showed outside the screen boundaries on small screen resolutions

This commit is contained in:
codeimp 2009-03-15 13:22:53 +00:00
parent e67c71d992
commit 334c51cacc
2 changed files with 10 additions and 0 deletions

BIN
Resources/Icons/Keys.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -214,6 +214,11 @@ namespace CodeImp.DoomBuilder.Controls
resoptions.StartPosition = FormStartPosition.Manual;
startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
startposition = this.RectangleToScreen(startposition);
Screen screen = Screen.FromPoint(startposition.Location);
if(startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
startposition.X = screen.WorkingArea.Right - resoptions.Size.Width;
if(startposition.Y + resoptions.Size.Height > screen.WorkingArea.Bottom)
startposition.Y = screen.WorkingArea.Bottom - resoptions.Size.Height;
resoptions.Location = startposition.Location;
if(resoptions.ShowDialog(this) == DialogResult.OK)
{
@ -244,6 +249,11 @@ namespace CodeImp.DoomBuilder.Controls
resoptions.StartPosition = FormStartPosition.Manual;
startposition = new Rectangle(dialogoffset.X, dialogoffset.Y, 1, 1);
startposition = this.RectangleToScreen(startposition);
Screen screen = Screen.FromPoint(startposition.Location);
if(startposition.X + resoptions.Size.Width > screen.WorkingArea.Right)
startposition.X = screen.WorkingArea.Right - resoptions.Size.Width;
if(startposition.Y + resoptions.Size.Height > screen.WorkingArea.Bottom)
startposition.Y = screen.WorkingArea.Bottom - resoptions.Size.Height;
resoptions.Location = startposition.Location;
if(resoptions.ShowDialog(this) == DialogResult.OK)
{