From bc88ed0cb997b30e3f090beea432006e98786bed Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 18 Mar 2015 13:21:32 +0000 Subject: [PATCH] Fixed bounding measurement of empty groups (fix #162) --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 76e998d9..1f34ab02 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6866,7 +6866,8 @@ void ImGui::EndGroup() ImGuiGroupData& group_data = window->DC.GroupStack.back(); ImRect group_bb(group_data.BackupCursorPos, window->DC.CursorMaxPos); - group_bb.Max.y -= style.ItemSpacing.y; + group_bb.Max.y -= style.ItemSpacing.y; // Cancel out last vertical spacing because we are adding one ourselves. + group_bb.Max = ImMax(group_bb.Min, group_bb.Max); window->DC.CursorPos = group_data.BackupCursorPos; window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos);