From f9e730e705faf61eb9881a9f592faca433b35bd3 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 2 Jun 2016 15:59:46 +0200 Subject: [PATCH] Tweaked comments. --- src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs b/src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs index 26b7ccf65f..fc7e36a2a1 100644 --- a/src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs +++ b/src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs @@ -258,7 +258,8 @@ namespace Avalonia.Controls.Presenters else { // Items have been removed and now the range FirstIndex..NextIndex goes out of - // the item bounds. Try to scroll up and then remove any excess containers. + // the item bounds. Remove any excess containers, try to scroll up and then recycle + // the containers to make sure they point to the correct item. var newFirstIndex = Math.Max(0, FirstIndex - (NextIndex - ItemCount)); var delta = newFirstIndex - FirstIndex; var newNextIndex = NextIndex + delta;