Fixes #1973. Avoid positioning Submenus off screen. (#1975)

* Fixes #1973. Avoid positioning Submenus off screen.

* Firstly avoids negative positions on the sub-menus and then avoids the bottom not exceeding the console height, as possible.
This commit is contained in:
BDisp
2022-09-05 14:17:58 +00:00
committed by GitHub
parent e767ae14eb
commit 13948501d5
3 changed files with 229 additions and 11 deletions

View File

@@ -670,7 +670,7 @@ Edit
menu.CloseAllMenus ();
menu.Frame = new Rect (0, 0, menu.Frame.Width, menu.Frame.Height);
((FakeDriver)Application.Driver).SetBufferSize (7, 4);
((FakeDriver)Application.Driver).SetBufferSize (7, 3);
menu.OpenMenu ();
Application.Refresh ();
@@ -681,7 +681,7 @@ Edit
";
pos = GraphViewTests.AssertDriverContentsWithFrameAre (expected, output);
Assert.Equal (new Rect (0, 1, 7, 3), pos);
Assert.Equal (new Rect (0, 0, 7, 3), pos);
}
[Fact, AutoInitShutdown]