Skip to content

Commit 1c67a34

Browse files
committed
BeginChild: also caller to manually set ImGuiNextWindowDataFlags_HasChildFlags / ChildFlags. (ocornut#8280)
1 parent 2b85456 commit 1c67a34

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

imgui.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -6049,9 +6049,12 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
60496049
}
60506050
SetNextWindowSize(size);
60516051

6052-
// Forward child flags
6052+
// Forward child flags (we allow prior settings to merge but it'll only work for adding flags)
6053+
if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasChildFlags)
6054+
g.NextWindowData.ChildFlags |= child_flags;
6055+
else
6056+
g.NextWindowData.ChildFlags = child_flags;
60536057
g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasChildFlags;
6054-
g.NextWindowData.ChildFlags = child_flags;
60556058

60566059
// 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.
60576060
// 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.

0 commit comments

Comments
 (0)