Search Issue Tracker
Won't Fix
Votes
0
Found in
2019.3.0b1
2019.3.0b3
2020.1.0a1
Issue ID
1185141
Regression
Yes
GUIContent with Texture does not follow GUILayout.Width style
How to reproduce:
1. Open the user's project
2. Open Tools > Example
Expected result: "Test 1" and "Test 2" Width is 150
Actual result: Width is larger
Reproducible with - 2019.3.0b1, 2019.3.0b4, 2020.1.0a5
Not reproducible with - 2017.4.32f1, 2018.4.8f1, 2019.2.7f2, 2019.3.0a11
Could not test with - 2019.3.0a12 (license issue)
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
- MaskField Choices Elements tooltip covers the entire window while scrolling through the Elements
- Reordering Enum Values in VFX Graph Uint Property expands the “Value” field
- Visual Effect Graph sample titles display in non-human-readable format
- UxmlNamespacePrefix does not apply when using UIBuilder documents
- UI Builder Data Path Source List starts flickering and scrolling when trying to select the last item in the list
Resolution Note (2020.1.X):
This behavior has not changed at all. GUILayout.Width is still followed. The computation of the button size uses the actual size of the texture and not the render size (16px), unless user calls EditorGUIUtility.SetIconSize(). It was working before because the prefab icon's size was 64px. But it is now 128px, which increased the button size by 64px and then exceeds 150px.
User can fix this issue on his side setting the icon size by calling EditorGUIUtility.SetIconSize().
For example,
var oldSize = EditorGUIUtility.GetIconSize()
EditorGUIUtility.SetIconSize(16);
// Render UI
EditorGUIUtility.SetIconSize(oldSize);