diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 7fec23e2e..dc204de75 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -1465,15 +1465,20 @@ void ImGui::Separator() if (window->SkipItems) return; + bool same_line = window->DC.IsSameLine; + // Those flags should eventually be configurable by the user // FIXME: We cannot g.Style.SeparatorTextBorderSize for thickness as it relates to SeparatorText() which is a decorated separator, not defaulting to 1.0f. - ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal; + ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal || same_line) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal; // Only applies to legacy Columns() api as they relied on Separator() a lot. if (window->DC.CurrentColumns) flags |= ImGuiSeparatorFlags_SpanAllColumns; SeparatorEx(flags, 1.0f); + + if (same_line) + SameLine (); } void ImGui::SeparatorTextEx(ImGuiID id, const char* label, const char* label_end, float extra_w)