mirror of
https://github.com/GrahamKracker/UnityExplorer.git
synced 2025-07-05 04:42:54 +08:00
Better JumpToIndex height calculation
This commit is contained in:
@ -142,7 +142,9 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
RefreshCells(true, true);
|
RefreshCells(true, true);
|
||||||
|
|
||||||
// Slide to the normalized position of the index
|
// 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));
|
RuntimeProvider.Instance.StartCoroutine(ForceDelayedJump(index, normalized, onJumped));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user