This commit is contained in:
Morilli 2024-12-02 00:07:19 +01:00
parent adf74495dc
commit cd7605d237
3 changed files with 4 additions and 8 deletions

View File

@ -92,9 +92,7 @@ namespace BizHawk.Client.EmuHawk
var topLeft = new Point(
Math.Max(0, form.Location.X),
Math.Max(0, form.Location.Y));
var screen = Screen.AllScreens
.Where(s => s.WorkingArea.Contains(topLeft))
.FirstOrDefault();
var screen = Screen.AllScreens.First(s => s.WorkingArea.Contains(topLeft));
var w = screen.WorkingArea.Right - form.Bounds.Right;
var h = screen.WorkingArea.Bottom - form.Bounds.Bottom;
if (h < 0) topLeft.Y += h;

View File

@ -661,8 +661,8 @@ namespace BizHawk.Client.EmuHawk
location.Offset(width + Width, 0);
}
Math.Max(0, location.Y);
var screen = Screen.AllScreens.Where(s => s.WorkingArea.Contains(location)).FirstOrDefault();
location.Y = Math.Max(0, location.Y);
var screen = Screen.AllScreens.First(s => s.WorkingArea.Contains(location));
var h = screen.WorkingArea.Bottom - bottom;
if (h < 0)

View File

@ -824,9 +824,7 @@ namespace BizHawk.Client.EmuHawk
var bottomRight = new Point(
topLeft.X + RightClickMenu.Width,
topLeft.Y + RightClickMenu.Height);
var screen = Screen.AllScreens
.Where(s => s.WorkingArea.Contains(topLeft))
.FirstOrDefault();
var screen = Screen.AllScreens.First(s => s.WorkingArea.Contains(topLeft));
// if we don't fully fit, move to the other side of the pointer
if (bottomRight.X > screen.WorkingArea.Right)
offset.X -= RightClickMenu.Width;