Search Issue Tracker
By Design
Votes
2
Found in
2018.4
2019.4
2020.3
2020.3.13f1
2021.1
2021.2
2022.1
Issue ID
1350545
Regression
No
HorizontalLayoutGroup fails to position children when entering/leaving Play Mode if ControlChildSize.Height is enabled
Reproduction steps:
1. Open the attached "1350545.zip" project
2. Notice how the red and green Panels are laid out
3. Enter Play Mode
Expected result: "PanelRed" and "PanelGreen" Panels are properly laid out
Actual result: "PanelRed" and "PanelGreen" Panels are laid out on top of each other
Reproducible with: 2018.4.36f1, 2019.4.29f1, 2020.3.15f1, 2021.1.16f1, 2021.2.0b5, 2022.1.0a3
Note:
- Triggering a layout update (like re-activating the "HorizontalLayoutGroup" Component) proceeds to layout the Panels properly until leaving/entering Play Mode
- Not reproducible with VerticalLayoutGroup
Comments (2)
-
Infenix
Nov 13, 2022 16:30
Despite I understand this is not what we are supposed to use, this is still what I'm using to fit images inside layout groups, as either width or height is subject to changes do to using layout groups. Therefore I do need to resize the other parameter (width/height) to a correct value as I want my image correctly displayed. When looking around researching how to achieve this behaviour, I only ended up here after multiple forum posts.
It looks strange as this seems to be a not so uncommon issue, but Unity tells us not to that. In this case, what am I supposed to use instead ?
-
gillemp
Jul 22, 2021 14:39
Information in the forum about the Issue: https://forum.unity.com/threads/bug-aspect-ratio-filter-not-being-applied.1140694/
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Warning of an unknown Script missing is logged when selecting VFX in Play Mode
- Vertical and horizontal scrollbars appear and disappear when dragging an attribute to a different position within the Shader Graph Hierarchy
- AudioSource.PlayDelayed() does not work with Audio Random Containers
- Compatible with the VFX Graph Shader Graph can't be dragged and dropped into the "Output" block from the Project window
- [Silicon] Freeze/crash on BrotliDecoderDecompressStream when using System.IO.Compression.BrotliDecoder.TryDecompress
Resolution Note:
The Aspect Ratio Fitter should not be used along with a parent that has a type of layout group component.
LayoutRebuilder.MarkLayoutForRebuild(HorizontalLayoutGroup) can be used as a workaround if the user still wants to use both components