UI: Prevent input configuration popups from appearing (partially) offscreen

This commit is contained in:
Sour 2019-01-03 18:14:14 -05:00
parent a489716ad8
commit a66b196831

View file

@ -412,11 +412,18 @@ namespace Mesen.GUI.Forms.Config
if(frm.Height + point.Y > screen.Bottom) { if(frm.Height + point.Y > screen.Bottom) {
//Show on top instead //Show on top instead
point.Y -= btn.Height + frm.Height; point.Y -= btn.Height + frm.Height;
if(point.Y < 0) {
point.Y = 0;
}
} }
if(frm.Width + point.X > screen.Right) { if(frm.Width + point.X > screen.Right) {
//Show on left instead //Show on left instead
point.X -= frm.Width - btn.Width; point.X -= frm.Width - btn.Width;
if(point.X < 0) {
point.X = 0;
}
} }
frm.Text = title; frm.Text = title;