Browse Source

Tweaked comments.

pull/558/head
Steven Kirk 10 years ago
parent
commit
f9e730e705
  1. 3
      src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs

3
src/Avalonia.Controls/Presenters/ItemVirtualizerSimple.cs

@ -258,7 +258,8 @@ namespace Avalonia.Controls.Presenters
else else
{ {
// Items have been removed and now the range FirstIndex..NextIndex goes out of // 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 newFirstIndex = Math.Max(0, FirstIndex - (NextIndex - ItemCount));
var delta = newFirstIndex - FirstIndex; var delta = newFirstIndex - FirstIndex;
var newNextIndex = NextIndex + delta; var newNextIndex = NextIndex + delta;

Loading…
Cancel
Save