Skip to content

Commit bd1fc49

Browse files
committed
Layout improvements
1 parent 20faf1b commit bd1fc49

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Editor/Elements/TriHeaderGroupBaseElement.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@ protected virtual void DrawContent(Rect position)
3232

3333
public sealed override float GetHeight(float width)
3434
{
35-
return GetContentHeight(width) + GetHeaderHeight(width) + InsetTop + InsetBottom;
35+
var headerHeight = GetHeaderHeight(width);
36+
var contentHeight = GetContentHeight(width);
37+
38+
var height = headerHeight + contentHeight;
39+
40+
if (contentHeight > 0)
41+
{
42+
height += InsetTop + InsetBottom;
43+
}
44+
45+
return height;
3646
}
3747

3848
public sealed override void OnGUI(Rect position)

0 commit comments

Comments
 (0)