mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-01-07 18:13:35 +08:00
Fix Take from sister cache
This commit is contained in:
parent
a4f774b6b2
commit
212d9a4d5e
@ -29,7 +29,7 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
this.sisterCache = sisterCache;
|
this.sisterCache = sisterCache;
|
||||||
|
|
||||||
ExplorerCore.Log("Creating backup height cache, this count: " + scrollPool.DataSource.ItemCount);
|
ExplorerCore.Log("Creating backup height cache, this count: " + scrollPool.DataSource.ItemCount);
|
||||||
AddRange(sisterCache.Take(scrollPool.DataSource.ItemCount));
|
TakeFromSister(scrollPool.DataSource.ItemCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly List<DataViewInfo> heightCache = new List<DataViewInfo>();
|
private readonly List<DataViewInfo> heightCache = new List<DataViewInfo>();
|
||||||
@ -77,9 +77,10 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
Add(entry);
|
Add(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<DataViewInfo> Take(int count)
|
public void TakeFromSister(int count)
|
||||||
{
|
{
|
||||||
return heightCache.Take(count);
|
for (int i = 0, i < count; i++)
|
||||||
|
Add(sisterCache[ScrollPool.DataSource.GetRealIndexForTempIndex(i)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveLast()
|
public void RemoveLast()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user