Browse Source

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

BDisp 4 năm trước cách đây
mục cha
commit
b351b858ae
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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 ();
 			}