BUG: Auto Layout: Horizontal layout cannot preserve child aspect but AspectRatioFitter is not layout aware
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reproducing the described Horizontal Layout Group and child AspectRatioFitter setup, including the overlapping children on Start(). Trace the layout pass after the fitter changes the child dimensions; done means horizontally arranged children preserve their aspect ratio, fill the intended height, and no longer overlap.
Written by the indexing model from the issue text.
Description
Suppose you want to a achieve an effect like the dock on MacOS where scaling the tray Rect causes the child icons to scale up while preserving their aspect and laying out horizontally center-middle.
This effect cannot be achieved because the layout can only upscale the width and height it cannot perform an aspect preserving scale.
Attaching an AspectRatioFitter to the child does achieve the desired effect, but on Start() the horizontal layout will shove all of the children to overlap each-other as I guess it believes their width is zero.
Then the layout group forces the scale height of the child to fill itself, and the aspect ratio fitter scales the object to the correct aspect because height controls width, but following this, the horizontal auto-layout does not execute again, so the newly sized rects do not correctly move into place.
- Dominant language
- C#
- Stars
- 1.6k
- Forks
- 323
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Unity-Technologies/uGUI
-
> - [ ] Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
Unity-Technologies/uGUI#22 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Unity-Technologies/uGUI#20 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Unity-Technologies/uGUI#17 ·
-
When clicking on a mobile platform, some gameobject will trigger OnEnter event without OnExit event Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Unity-Technologies/uGUI#16 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Unity-Technologies/uGUI#15 ·
All issues in Unity-Technologies/uGUI
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·