Ver Fonte

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

Paul Sanford há 7 anos atrás
pai
commit
2f1336a2bf
1 ficheiros alterados com 7 adições e 4 exclusões
  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);
+				}
 			}
 		}