Skip to content

Commit a074256

Browse files
committed
force ScrollRect.content setup
1 parent 0747258 commit a074256

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Runtime/Scripts/Layout/ScrollSnapBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ void Awake()
189189

190190
_screensContainer = _scroll_rect.content;
191191

192+
//ScrollRect.content RT anchors has to be stretched first in order for HSS/VSS.DistributePages() to have the correct result
193+
_screensContainer.anchorMin = Vector2.zero;
194+
_screensContainer.anchorMax = Vector2.one;
195+
_screensContainer.sizeDelta = Vector2.zero;
196+
192197
InitialiseChildObjects();
193198

194199
if (NextButton)

0 commit comments

Comments
 (0)