@@ -5445,7 +5445,6 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
5445
5445
5446
5446
ImGuiWindow* child_window = g.CurrentWindow;
5447
5447
child_window->ChildId = id;
5448
- child_window->AutoFitChildAxises = (ImS8)auto_fit_axises;
5449
5448
5450
5449
// Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually.
5451
5450
// While this is not really documented/defined, it seems that the expected thing to do.
@@ -5488,22 +5487,13 @@ void ImGui::EndChild()
5488
5487
IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() calls
5489
5488
5490
5489
g.WithinEndChild = true;
5491
- if (window->BeginCount > 1)
5492
- {
5493
- End();
5494
- }
5495
- else
5490
+ ImVec2 child_size = window->Size;
5491
+ End();
5492
+ if (window->BeginCount == 1)
5496
5493
{
5497
- ImVec2 sz = window->Size;
5498
- if (window->AutoFitChildAxises & (1 << ImGuiAxis_X)) // Arbitrary minimum zero-ish child size of 4.0f causes less trouble than a 0.0f
5499
- sz.x = ImMax(4.0f, sz.x);
5500
- if (window->AutoFitChildAxises & (1 << ImGuiAxis_Y))
5501
- sz.y = ImMax(4.0f, sz.y);
5502
- End();
5503
-
5504
5494
ImGuiWindow* parent_window = g.CurrentWindow;
5505
- ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz );
5506
- ItemSize(sz );
5495
+ ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + child_size );
5496
+ ItemSize(child_size );
5507
5497
if ((window->DC.NavLayersActiveMask != 0 || window->DC.NavWindowHasScrollY) && !(window->Flags & ImGuiWindowFlags_NavFlattened))
5508
5498
{
5509
5499
ItemAdd(bb, window->ChildId);
0 commit comments