mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
Fixed resource options dialog being showed outside the screen boundaries on small screen resolutions
This commit is contained in:
parent
e67c71d992
commit
334c51cacc
2 changed files with 10 additions and 0 deletions
BIN
Resources/Icons/Keys.ico
Normal file
BIN
Resources/Icons/Keys.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue