2
0
Эх сурвалжийг харах

Fixing ListView TopItem and LeftItem.

BDisp 4 жил өмнө
parent
commit
2f488c5572

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

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