VirtualizedScrollRectList spawns pool items at an angle[BUG] #534
Labels
Package: UX Core
The Project ux core package is impacted by this issue.
Type: Bug
A problem with an existing feature that can be fixed with the next patched release.
Describe the bug
When using the VirtualizedScrollRectList, the pool item prefabs are spawned as children of scrollRect.content with an initial rotation of Quaternion.identity. If the ScollRect or content are rotated, this will spawn the pool items at an angle to the ScrollRect whereas the desired behaviour is probably to spawn them aligned.
To fix the issue we can replace line 414 in VirtualizedScrollRectList.cs
GameObject go = Instantiate(prefab, ItemLocation(-(i + 1)), Quaternion.identity, scrollRect.content);
with
GameObject go = Instantiate(prefab, ItemLocation(-(i + 1)), scrollRect.content.rotation, scrollRect.content);
which produces the expected behaviour.
To reproduce
Steps to reproduce the behavior:
Expected behavior
The children should spawn aligned with the ScrollRect/its parent canvas.
Screenshots
Your setup (please complete the following information)
The text was updated successfully, but these errors were encountered: