mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-12 01:25:19 -05:00
Fix form centering to non-primary screen
The first screen is configured with origin coordinates 0,0; any other screens that are arranged to the left or below will have coordinates in the negative. Negative coordinates are valid; don't sanitize.
This commit is contained in:
@@ -27,7 +27,7 @@ internal static void CenterToForm(this Control child, Control? parent)
|
||||
return;
|
||||
int x = parent.Location.X + ((parent.Width - child.Width) / 2);
|
||||
int y = parent.Location.Y + ((parent.Height - child.Height) / 2);
|
||||
child.Location = new Point(Math.Max(x, 0), Math.Max(y, 0));
|
||||
child.Location = new Point(x, y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user