From 674a778bf90154073a23b7f5ea011bb5db58ecdc Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 3 Jan 2025 13:35:54 -0600 Subject: [PATCH] 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. --- PKHeX.WinForms/Util/WinFormsUtil.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Util/WinFormsUtil.cs b/PKHeX.WinForms/Util/WinFormsUtil.cs index db3f56bda..adeea5e3b 100644 --- a/PKHeX.WinForms/Util/WinFormsUtil.cs +++ b/PKHeX.WinForms/Util/WinFormsUtil.cs @@ -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); } ///