diff --git a/Scripts/Layout/HorizontalScrollSnap.cs b/Scripts/Layout/HorizontalScrollSnap.cs index d2e6f2a..d15d3d4 100644 --- a/Scripts/Layout/HorizontalScrollSnap.cs +++ b/Scripts/Layout/HorizontalScrollSnap.cs @@ -211,7 +211,7 @@ namespace UnityEngine.UI.Extensions RectTransform child = _screensContainer.transform.GetChild(i).gameObject.GetComponent(); currentXPosition = _offset + i * _step; child.anchoredPosition = new Vector2(currentXPosition, 0f); - child.sizeDelta = new Vector2(gameObject.GetComponent().sizeDelta.x, gameObject.GetComponent().sizeDelta.y); + child.sizeDelta = new Vector2(gameObject.GetComponent().rect.width, gameObject.GetComponent().rect.height); } _dimension = currentXPosition + _offset * -1;