Search Issue Tracker
Fixed in 2021.1.X
Votes
0
Found in
2019.4
2019.4.1f1
2021.1
Issue ID
1289492
Regression
No
[UIElements] EditorGUIUtility.currentWidth returns 0 when using it in a VisualElement
How to reproduce:
1. Open the user's attached "UnityBugUIToolkitInspectorWidth.zip" project
2. Open the "SampleScene" Scene
3. Select "GameObject1" GameObject in the Hierarchy window
4. Observe the Console log
Expected result: Inspector window's width is printed in the Console log
Actual result: "inspector width = 0" is printed in the Console log (indicating that Inspector window's width is not received correctly)
Reproducible with: 2019.4.14f1, 2020.1.13f1, 2020.2.0b11, 2021.1.0a4
Could not test with: 2018.4.29f1 (UIElements are not supported)
Notes:
- EditorGUIUtility.currentWidth returns correct width in the very first time, but later returns 0
- EditorGUIUtility.currentWidth returns correct width when not using it with UIElements
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
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
Resolution Note (fix version 2021.1):
Fixed in: 2021.1.0a9 wont be backported as the fix is to just make it more obvious this functionality is not supported outside of IMGUI