Skip to content

Commit cb7e1c1

Browse files
committed
Separator: Fixed zero-height bounding box resulting in clipping when at top of clipping rectangle (ocornut#860)
1 parent 31dc7d8 commit cb7e1c1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

imgui.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9092,16 +9092,16 @@ void ImGui::Separator()
90929092
if (!window->DC.GroupStack.empty())
90939093
x1 += window->DC.IndentX;
90949094

9095-
const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y));
9096-
ItemSize(ImVec2(0.0f, 0.0f)); // NB: we don't provide our width so that it doesn't get feed back into AutoFit // FIXME: Height should be 1.0f not 0.0f ?
9095+
const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y+1.0f));
9096+
ItemSize(ImVec2(0.0f, 0.0f)); // NB: we don't provide our width so that it doesn't get feed back into AutoFit, we don't provide height to not alter layout.
90979097
if (!ItemAdd(bb, NULL))
90989098
{
90999099
if (window->DC.ColumnsCount > 1)
91009100
PushColumnClipRect();
91019101
return;
91029102
}
91039103

9104-
window->DrawList->AddLine(bb.Min, bb.Max, GetColorU32(ImGuiCol_Border));
9104+
window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x,bb.Min.y), GetColorU32(ImGuiCol_Border));
91059105

91069106
ImGuiContext& g = *GImGui;
91079107
if (g.LogEnabled)

0 commit comments

Comments
 (0)