فهرست منبع

Fixing ListView TopItem and LeftItem.

BDisp 4 سال پیش
والد
کامیت
2f488c5572
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      Terminal.Gui/Views/ListView.cs

+ 2 - 2
Terminal.Gui/Views/ListView.cs

@@ -210,7 +210,7 @@ namespace Terminal.Gui {
 				if (source == null)
 				if (source == null)
 					return;
 					return;
 
 
-				if (top < 0 || top >= source.Count)
+				if (top < 0 || (source.Count > 0 && top >= source.Count))
 					throw new ArgumentException ("value");
 					throw new ArgumentException ("value");
 				top = value;
 				top = value;
 				SetNeedsDisplay ();
 				SetNeedsDisplay ();
@@ -227,7 +227,7 @@ namespace Terminal.Gui {
 				if (source == null)
 				if (source == null)
 					return;
 					return;
 
 
-				if (left < 0 || top >= source.Count)
+				if (left < 0 || (Maxlength > 0 && left >= Maxlength))
 					throw new ArgumentException ("value");
 					throw new ArgumentException ("value");
 				left = value;
 				left = value;
 				SetNeedsDisplay ();
 				SetNeedsDisplay ();