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
- The Scene View becomes gray and "NullReferenceException" errors are thrown when attaching the Unity Editor process to RenderDoc
- Memory usage rapidly rises when changing colors in the color wheel
- Physically Based Sky's Horizon and Zenith Tint Color Selection Bars don't have immediate access to color pickers
- EmptyAdditionalLightShadowmapTexture leaks from memory when URP quality level is changed using QualitySettings.SetQualityLevel
- Referenced ScriptableObject field does not get updated and cannot be set to "None" when there are no Objects of that type
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