diff --git a/Scripts/Layout/HorizontalScrollSnap.cs b/Scripts/Layout/HorizontalScrollSnap.cs index 3fe3cfe..1a85021 100644 --- a/Scripts/Layout/HorizontalScrollSnap.cs +++ b/Scripts/Layout/HorizontalScrollSnap.cs @@ -16,6 +16,7 @@ namespace UnityEngine.UI.Extensions _isVertical = false; _childAnchorPoint = new Vector2(0, 0.5f); _currentPage = StartingScreen; + panelDimensions = gameObject.GetComponent().rect; UpdateLayout(); } diff --git a/Scripts/Layout/VerticalScrollSnap.cs b/Scripts/Layout/VerticalScrollSnap.cs index 8cb9fbf..f6be4ec 100644 --- a/Scripts/Layout/VerticalScrollSnap.cs +++ b/Scripts/Layout/VerticalScrollSnap.cs @@ -16,6 +16,7 @@ namespace UnityEngine.UI.Extensions _isVertical = true; _childAnchorPoint = new Vector2(0.5f,0); _currentPage = StartingScreen; + panelDimensions = gameObject.GetComponent().rect; UpdateLayout(); }