mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-26 13:37:00 +00:00
Begin: Move code from BeginChild() to EndChild() to allow End() calling EndChild() in new-begin experiments.
This commit is contained in:
parent
dd4ca70b0d
commit
8035405481
10
imgui.cpp
10
imgui.cpp
@ -5124,11 +5124,6 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
|
|||||||
child_window->ChildId = id;
|
child_window->ChildId = id;
|
||||||
child_window->AutoFitChildAxises = (ImS8)auto_fit_axises;
|
child_window->AutoFitChildAxises = (ImS8)auto_fit_axises;
|
||||||
|
|
||||||
// Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually.
|
|
||||||
// While this is not really documented/defined, it seems that the expected thing to do.
|
|
||||||
if (child_window->BeginCount == 1)
|
|
||||||
parent_window->DC.CursorPos = child_window->Pos;
|
|
||||||
|
|
||||||
// Process navigation-in immediately so NavInit can run on first frame
|
// Process navigation-in immediately so NavInit can run on first frame
|
||||||
if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayerActiveMask != 0 || child_window->DC.NavHasScroll))
|
if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayerActiveMask != 0 || child_window->DC.NavHasScroll))
|
||||||
{
|
{
|
||||||
@ -5160,6 +5155,11 @@ void ImGui::EndChild()
|
|||||||
IM_ASSERT(g.WithinEndChild == false);
|
IM_ASSERT(g.WithinEndChild == false);
|
||||||
IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() calls
|
IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() calls
|
||||||
|
|
||||||
|
// Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually.
|
||||||
|
// While this is not really documented/defined, it seems that the expected thing to do.
|
||||||
|
if (window->BeginCount == 1)
|
||||||
|
window->ParentWindow->DC.CursorPos = window->Pos;
|
||||||
|
|
||||||
g.WithinEndChild = true;
|
g.WithinEndChild = true;
|
||||||
if (window->BeginCount > 1)
|
if (window->BeginCount > 1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user