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
- Video does not play in macOS build when built app is placed in a path with a space in it on a specific project
 - Crash on AuxWindowManager::OnGotFocus when trying to maximize a tab while Visual Effect Graph window is open
 - “NullReferenceException: Object reference not set to an instance of an object” error is thrown when
 - [Metal] Game freezes after command buffer Timeout error
 - Addressables Report window UI is broken when opening via Build > New Build > Default Build Script
 
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);