Skip to content

Commit

Permalink
BeginChild: also caller to manually set ImGuiNextWindowDataFlags_HasC…
Browse files Browse the repository at this point in the history
…hildFlags / ChildFlags. (#8280)
  • Loading branch information
ocornut committed Jan 8, 2025
1 parent 2b85456 commit 1c67a34
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6049,9 +6049,12 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
}
SetNextWindowSize(size);

// Forward child flags
// Forward child flags (we allow prior settings to merge but it'll only work for adding flags)
if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasChildFlags)
g.NextWindowData.ChildFlags |= child_flags;
else
g.NextWindowData.ChildFlags = child_flags;
g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasChildFlags;
g.NextWindowData.ChildFlags = child_flags;

// Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value.
// FIXME: 2023/11/14: commented out shorted version. We had an issue with multiple ### in child window path names, which the trailing hash helped workaround.
Expand Down

0 comments on commit 1c67a34

Please sign in to comment.