Browse Source

Fix bug in ListView that caused it to render spaces off the window

Paul Sanford 7 years ago
parent
commit
2f1336a2bf
1 changed files with 7 additions and 4 deletions
  1. 7 4
      Terminal.Gui/Views/ListView.cs

+ 7 - 4
Terminal.Gui/Views/ListView.cs

@@ -299,11 +299,14 @@ namespace Terminal.Gui {
 					Driver.SetAttribute (newcolor);
 					current = newcolor;
 				}
-				if (item >= source.Count)
+
+				if (item >= source.Count) {
+					Move(0, row);
 					for (int c = 0; c < f.Width; c++)
-						Driver.AddRune (' ');
-				else
-					Source.Render (isSelected, item, 0, row, f.Width);
+						Driver.AddRune(' ');
+				} else {
+					Source.Render(isSelected, item, 0, row, f.Width);
+				}
 			}
 		}