Skip to content

Commit

Permalink
接入Nova时发现: SizeHelper是不需要考虑contentSpacing的
Browse files Browse the repository at this point in the history
  • Loading branch information
qiankanglai committed Jul 17, 2022
1 parent c6da00a commit 92dcc11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Runtime/LoopScrollRectBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ public void SrollToCellWithinTime(int index, float time)
{
if (sizeHelper != null)
{
dist = GetDimension(sizeHelper.GetItemsSize(currentFirst) - sizeHelper.GetItemsSize(index));
dist = GetDimension(sizeHelper.GetItemsSize(currentFirst) - sizeHelper.GetItemsSize(index)) + contentSpacing * (CurrentLine - TargetLine - 1);
dist += offset;
}
else
Expand Down Expand Up @@ -1587,7 +1587,7 @@ private void GetHorizonalOffsetAndSize(out float totalSize, out float offset)
{
if (sizeHelper != null)
{
totalSize = sizeHelper.GetItemsSize(TotalLines).x;
totalSize = sizeHelper.GetItemsSize(TotalLines).x + contentSpacing * (TotalLines - 1);
offset = m_ContentBounds.min.x - sizeHelper.GetItemsSize(StartLine).x - contentSpacing * StartLine;
}
else
Expand All @@ -1602,7 +1602,7 @@ private void GetVerticalOffsetAndSize(out float totalSize, out float offset)
{
if (sizeHelper != null)
{
totalSize = sizeHelper.GetItemsSize(TotalLines).y;
totalSize = sizeHelper.GetItemsSize(TotalLines).y + contentSpacing * (TotalLines - 1);
offset = m_ContentBounds.max.y + sizeHelper.GetItemsSize(StartLine).y + contentSpacing * StartLine;
}
else
Expand Down

0 comments on commit 92dcc11

Please sign in to comment.