浏览代码

Only sets the top if the sum (top + selected) is bigger than the frame height.

BDisp 4 年之前
父节点
当前提交
b351b858ae
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Terminal.Gui/Views/ListView.cs

+ 3 - 1
Terminal.Gui/Views/ListView.cs

@@ -559,7 +559,9 @@ namespace Terminal.Gui {
 		{
 			if (source.Count > 0 && selected != source.Count - 1) {
 				selected = source.Count - 1;
-				top = selected;
+				if (top + selected > Frame.Height - 1) {
+					top = selected;
+				}
 				OnSelectedChanged ();
 				SetNeedsDisplay ();
 			}