setchi / FancyScrollView

[Unity] Scroll view component that can implement highly flexible animations.
https://setchi.jp/FancyScrollView/
MIT License
3.04k stars 385 forks source link

give some explanation about how get first index and position? #60

Open kkjusdoit opened 1 year ago

kkjusdoit commented 1 year ago
    var p = position - scrollOffset / cellInterval; 
    var firstIndex = Mathf.CeilToInt(p);
    var firstPosition = (Mathf.Ceil(p) - p);// * cellInterval; 

Hi @setchi I'm new learning your code, I have problem to understand above caculation, why this can get first index and position?

kkjusdoit commented 1 year ago

how do you design the formula