Update DataHeightCache.cs

This commit is contained in:
Sinai 2021-04-28 21:20:41 +10:00 committed by GitHub
parent b0d54b1d80
commit 99e11b41a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,10 +124,9 @@ namespace UnityExplorer.UI.Widgets
return 0; return 0;
if (rangeIndex >= rangeCache.Count) if (rangeIndex >= rangeCache.Count)
{ {
ExplorerCore.Log("desiredHeight is " + desiredHeight + ", but our total height is " + totalHeight + ", clamping to data count"); int idx = ScrollPool.DataSource.ItemCount - 1;
ExplorerCore.Log("highest data index: " + (ScrollPool.DataSource.ItemCount - 1) + ", rangeIndex was " + rangeIndex + ", actual range limit is " + (rangeCache.Count - 1)); cache = heightCache[idx];
cache = heightCache[heightCache.Count - 1]; return idx;
return ScrollPool.DataSource.ItemCount - 1;
} }
int dataIndex = rangeCache[rangeIndex]; int dataIndex = rangeCache[rangeIndex];