int GetIndexOnPos3(ref float pos, bool forceUpdate)
{
if (_realNumItems < _curLineItemCount)
{
pos = 0;
return 0;
}
float viewWidth = this.viewWidth;
int page = Mathf.FloorToInt(pos / viewWidth);
int startIndex = page * (_curLineItemCount * _curLineItemCount2);
float pos2 = page * viewWidth;
for (int i = 0; i < _curLineItemCount; i++)
{
float pos3 = pos2 + _virtualItems[startIndex + i].size.x + _columnGap;
if (pos3 > pos)
{
pos = pos2;
return startIndex + i;
}
pos2 = pos3;
}
pos = pos2;
return startIndex + _curLineItemCount - 1;
}