Fixing bug in EnsuresVisibilitySelectedItem on ListView.

This commit is contained in:
BDisp
2021-01-17 02:02:52 +00:00
parent 0f038c76e1
commit 8f4924e40f

View File

@@ -679,9 +679,10 @@ namespace Terminal.Gui {
void EnsuresVisibilitySelectedItem ()
{
SuperView?.LayoutSubviews ();
if (selected < top) {
top = selected;
} else if (selected >= top + Frame.Height) {
} else if (Frame.Height > 0 && selected >= top + Frame.Height) {
top = Math.Max (selected - Frame.Height + 2, 0);
}
}