Hi!
I’m currently implementing a custom property drawer for an attribute.
To create a label previewing an icon, I’ve added this to my property drawer:
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
var controlId = GUIUtility.GetControlID(FocusType.Passive, position);
position = EditorGUI.PrefixLabel(position, controlId, new GUIContent(previewIcon),
new GUIStyle(EditorStyles.label) { fontSize = 46 });
EditorGUI.EndProperty();
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) => 46;
As you can see, I return 46 as height for the label and also 46 for the font size. However, the text is truncated even there is more space available:
I’d expect that at least it should not be truncated at the bottom.
What else do I need to do, that the label uses more space to fully show the text?
Thanks!