From cb7e1c18b57092da146307557b3e9d1fead7430f Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 10 Oct 2016 22:37:59 +0200 Subject: [PATCH] Separator: Fixed zero-height bounding box resulting in clipping when at top of clipping rectangle (#860) --- imgui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 26be158d..3bb3241b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9092,8 +9092,8 @@ void ImGui::Separator() if (!window->DC.GroupStack.empty()) x1 += window->DC.IndentX; - const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y)); - 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 ? + const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y+1.0f)); + 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. if (!ItemAdd(bb, NULL)) { if (window->DC.ColumnsCount > 1) @@ -9101,7 +9101,7 @@ void ImGui::Separator() return; } - window->DrawList->AddLine(bb.Min, bb.Max, GetColorU32(ImGuiCol_Border)); + window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x,bb.Min.y), GetColorU32(ImGuiCol_Border)); ImGuiContext& g = *GImGui; if (g.LogEnabled)