Skip to content

Commit

Permalink
Separator() within group start on group horizontal offset #205
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Apr 27, 2015
1 parent 1d90f09 commit bd23c11
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit bd23c11

Please sign in to comment.