From a66b196831107552b099cf5c1c8de8109810acca Mon Sep 17 00:00:00 2001 From: Sour Date: Thu, 3 Jan 2019 18:14:14 -0500 Subject: [PATCH] UI: Prevent input configuration popups from appearing (partially) offscreen --- GUI.NET/Forms/Config/frmInputConfig.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GUI.NET/Forms/Config/frmInputConfig.cs b/GUI.NET/Forms/Config/frmInputConfig.cs index 8dd1fba6..01cb4b9e 100644 --- a/GUI.NET/Forms/Config/frmInputConfig.cs +++ b/GUI.NET/Forms/Config/frmInputConfig.cs @@ -412,11 +412,18 @@ namespace Mesen.GUI.Forms.Config if(frm.Height + point.Y > screen.Bottom) { //Show on top instead point.Y -= btn.Height + frm.Height; + + if(point.Y < 0) { + point.Y = 0; + } } if(frm.Width + point.X > screen.Right) { //Show on left instead point.X -= frm.Width - btn.Width; + if(point.X < 0) { + point.X = 0; + } } frm.Text = title;