UI: Prevent input configuration popups from appearing (partially) offscreen
This commit is contained in:
parent
a489716ad8
commit
a66b196831
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue