Better JumpToIndex height calculation

This commit is contained in:
Sinai
2021-05-27 19:44:17 +10:00
parent 5515b2eae4
commit a46acba265

View File

@ -142,7 +142,9 @@ namespace UnityExplorer.UI.Widgets
RefreshCells(true, true);
// Slide to the normalized position of the index
float normalized = HeightCache[index].startPosition / HeightCache.TotalHeight;
var cache = HeightCache[index];
float normalized = (cache.startPosition + (cache.height * 0.5f)) / HeightCache.TotalHeight;
RuntimeProvider.Instance.StartCoroutine(ForceDelayedJump(index, normalized, onJumped));
}