Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli committed Dec 1, 2024
1 parent adf7449 commit cd7605d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions src/BizHawk.Client.EmuHawk/Extensions/ControlExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ public static DialogResult ShowDialogOnScreen(this Form form)
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ private void BranchView_PointedCellChanged(object sender, InputRoll.CellEventArg
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,7 @@ private void TasView_MouseUp(object sender, MouseEventArgs e)
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;
Expand Down

0 comments on commit cd7605d

Please sign in to comment.