2
0
Эх сурвалжийг харах

Fixed bounding measurement of empty groups (fix #162)

ocornut 10 жил өмнө
parent
commit
bc88ed0cb9
1 өөрчлөгдсөн 2 нэмэгдсэн , 1 устгасан
  1. 2 1
      imgui.cpp

+ 2 - 1
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);