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
- "Draw Additional Lights Shadowmap" calls increase when custom MaterialBlockProperty is used
- Crash on _platform_memmove when importing the "Dragon Crashers - URP 2D Sample Project" to a new 2D project
- "Shader is not supported on this GPU" warnings and and shaders are not loading when building the project for non-Chromium browsers
- [iOS][URP] The screen flickers and the "Execution of the command buffer was aborted due to an error during execution" error is thrown continuously
- Shortcut Manager shows empty conflict filter when resolving runtime conflicts involving different contexts
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);