Search Issue Tracker
By Design
By Design in 2023.2.X
Votes
0
Found in
2021.3.20f1
2022.2.10f1
2023.1.0b7
2023.2.0a5
Issue ID
UUM-29175
Regression
No
[UI Toolkit] Label size takes more than 100% width when set to 100%
How to reproduce:
1. Open the attached "repro_project.zip" project
2. Open UI/CauldronUI/CauldronMainUI.uxml
3. Select Screen > Top > Label component in the hierarchy and observe the right side
Expected result: Label is fit to the "Top" visual element's size
Actual result: Label is out of bounds
Reproducible with: 2021.3.20f1, 2022.2.10f1, 2023.1.0b7, 2023.2.0a5
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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
Unity’s model is equivalent to setting the CSS box-sizing property to border-box (mentioned in the doc here: https://docs.unity3d.com/Manual/UIE-USS-SupportedProperties.html).
See this page for details https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing.
The Label in the repro project has a margin set, that's why it is wider than the parent.
Resolution Note (2023.2.X):
Unity’s model is equivalent to setting the CSS box-sizing property to border-box (mentioned in the doc here: https://docs.unity3d.com/Manual/UIE-USS-SupportedProperties.html).
See this page for details https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing.
The Label in the repro project has a margin set, that's why it is wider than the parent.