From bd23c11a937ca25c911c287ccad77bf2e82c82b0 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 27 Apr 2015 22:19:14 +0200 Subject: [PATCH] Separator() within group start on group horizontal offset #205 --- imgui.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 86ad7466c..101fc249c 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7330,7 +7330,12 @@ void ImGui::Separator() if (window->DC.ColumnsCount > 1) PopClipRect(); - const ImRect bb(ImVec2(window->Pos.x, window->DC.CursorPos.y), ImVec2(window->Pos.x + window->Size.x, window->DC.CursorPos.y)); + float x1 = window->Pos.x; + float x2 = window->Pos.x + window->Size.x; + if (!window->DC.GroupStack.empty()) + x1 += window->DC.ColumnsStartX; + + const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y)); ItemSize(ImVec2(0.0f, bb.GetSize().y)); // NB: we don't provide our width so that it doesn't get feed back into AutoFit if (!ItemAdd(bb, NULL)) {