diff --git a/Assets/Scripts/Component/UI/BFScrollRect/BFScrollRectCommon.cs b/Assets/Scripts/Component/UI/BFScrollRect/BFScrollRectCommon.cs index 156f6eac6..50cdc66e2 100644 --- a/Assets/Scripts/Component/UI/BFScrollRect/BFScrollRectCommon.cs +++ b/Assets/Scripts/Component/UI/BFScrollRect/BFScrollRectCommon.cs @@ -548,7 +548,7 @@ namespace BF if (direction == BFUIDirection.Vertical) { float moveDistance = cellHeight * Mathf.Floor((index - 1)*1.0f/perLineNum); - float moveHeight = Mathf.Min(moveDistance, ContentTrans.sizeDelta.y - ViewPortTrans.sizeDelta.y); + float moveHeight = Mathf.Min(moveDistance, ContentTrans.rect.size.y - ViewPortTrans.rect.size.y); if(this.reverse) { ContentTrans.anchoredPosition = new Vector2(ContentTrans.anchoredPosition.x, -moveHeight); @@ -561,7 +561,7 @@ namespace BF else { float moveDistance = cellWidth * Mathf.Floor((index - 1)*1.0f/perLineNum); - float moveWidth = Mathf.Min(moveDistance, ContentTrans.sizeDelta.x - ViewPortTrans.sizeDelta.x); + float moveWidth = Mathf.Min(moveDistance, ContentTrans.rect.size.x - ViewPortTrans.rect.size.x); if(this.reverse) { ContentTrans.anchoredPosition = new Vector2(moveWidth, ContentTrans.anchoredPosition.y);