From bd1fc4935bfe773dc8a3552e8a13bdc955319de7 Mon Sep 17 00:00:00 2001 From: VladV Date: Sat, 24 Jun 2023 16:43:22 +0400 Subject: [PATCH] Layout improvements --- Editor/Elements/TriHeaderGroupBaseElement.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Editor/Elements/TriHeaderGroupBaseElement.cs b/Editor/Elements/TriHeaderGroupBaseElement.cs index 03f07a6..264f0bc 100644 --- a/Editor/Elements/TriHeaderGroupBaseElement.cs +++ b/Editor/Elements/TriHeaderGroupBaseElement.cs @@ -32,7 +32,17 @@ namespace TriInspector.Elements public sealed override float GetHeight(float width) { - return GetContentHeight(width) + GetHeaderHeight(width) + InsetTop + InsetBottom; + var headerHeight = GetHeaderHeight(width); + var contentHeight = GetContentHeight(width); + + var height = headerHeight + contentHeight; + + if (contentHeight > 0) + { + height += InsetTop + InsetBottom; + } + + return height; } public sealed override void OnGUI(Rect position)