diff --git a/Assets/NaughtyAttributes/Scripts/Editor/DecoratorDrawers/InfoBoxDecoratorDrawer.cs b/Assets/NaughtyAttributes/Scripts/Editor/DecoratorDrawers/InfoBoxDecoratorDrawer.cs index 18a979c2..08841509 100644 --- a/Assets/NaughtyAttributes/Scripts/Editor/DecoratorDrawers/InfoBoxDecoratorDrawer.cs +++ b/Assets/NaughtyAttributes/Scripts/Editor/DecoratorDrawers/InfoBoxDecoratorDrawer.cs @@ -8,7 +8,7 @@ public class InfoBoxDecoratorDrawer : DecoratorDrawer { public override float GetHeight() { - return GetHelpBoxHeight(); + return GetHelpBoxHeight() + EditorGUIUtility.standardVerticalSpacing; } public override void OnGUI(Rect rect) diff --git a/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/PropertyDrawerBase.cs b/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/PropertyDrawerBase.cs index 883d1ffa..88873d88 100644 --- a/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/PropertyDrawerBase.cs +++ b/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/PropertyDrawerBase.cs @@ -71,6 +71,11 @@ public virtual float GetHelpBoxHeight() return EditorGUIUtility.singleLineHeight * 2.0f; } + protected virtual float GetHelpBoxPadding() + { + return EditorGUIUtility.standardVerticalSpacing; + } + public void DrawDefaultPropertyAndHelpBox(Rect rect, SerializedProperty property, string message, MessageType messageType) { float indentLength = NaughtyEditorGUI.GetIndentLength(rect); @@ -78,7 +83,7 @@ public void DrawDefaultPropertyAndHelpBox(Rect rect, SerializedProperty property rect.x + indentLength, rect.y, rect.width - indentLength, - GetHelpBoxHeight()); + GetHelpBoxHeight() - GetHelpBoxPadding()); NaughtyEditorGUI.HelpBox(helpBoxRect, message, MessageType.Warning, context: property.serializedObject.targetObject); diff --git a/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs b/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs index 3790442b..853f37f6 100644 --- a/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs +++ b/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers_SpecialCase/ReorderableListPropertyDrawer.cs @@ -75,7 +75,7 @@ protected override void OnGUI_Internal(Rect rect, SerializedProperty property, G elementHeightCallback = (int index) => { - return EditorGUI.GetPropertyHeight(property.GetArrayElementAtIndex(index)) + 4.0f; + return EditorGUI.GetPropertyHeight(property.GetArrayElementAtIndex(index)) + EditorGUIUtility.standardVerticalSpacing; } };