|
|
|
@ -9893,10 +9893,23 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl |
|
|
|
|
// Horizontal separating line.
|
|
|
|
|
void ImGui::Separator() |
|
|
|
|
{ |
|
|
|
|
ImGuiContext& g = *GImGui; |
|
|
|
|
ImGuiWindow* window = GetCurrentWindow(); |
|
|
|
|
if (window->SkipItems) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
ImGuiWindowFlags flags = 0; |
|
|
|
|
if ((flags & (ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical)) == 0) |
|
|
|
|
{ |
|
|
|
|
if (window->DC.LayoutType == ImGuiLayoutType_Horizontal) |
|
|
|
|
flags |= ImGuiSeparatorFlags_Vertical; |
|
|
|
|
else |
|
|
|
|
flags |= ImGuiSeparatorFlags_Horizontal; |
|
|
|
|
} |
|
|
|
|
IM_ASSERT(ImIsPowerOfTwo((int)(flags & (ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical)))); // Check that only 1 option is selected
|
|
|
|
|
|
|
|
|
|
if (flags & ImGuiSeparatorFlags_Horizontal) |
|
|
|
|
{ |
|
|
|
|
if (window->DC.ColumnsCount > 1) |
|
|
|
|
PopClipRect(); |
|
|
|
|
|
|
|
|
@ -9916,7 +9929,6 @@ void ImGui::Separator() |
|
|
|
|
|
|
|
|
|
window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x,bb.Min.y), GetColorU32(ImGuiCol_Separator)); |
|
|
|
|
|
|
|
|
|
ImGuiContext& g = *GImGui; |
|
|
|
|
if (g.LogEnabled) |
|
|
|
|
LogText(IM_NEWLINE "--------------------------------"); |
|
|
|
|
|
|
|
|
@ -9925,6 +9937,19 @@ void ImGui::Separator() |
|
|
|
|
PushColumnClipRect(); |
|
|
|
|
window->DC.ColumnsCellMinY = window->DC.CursorPos.y; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (flags & ImGuiSeparatorFlags_Vertical) |
|
|
|
|
{ |
|
|
|
|
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(1.0f, window->DC.CurrentLineHeight)); |
|
|
|
|
ItemSize(ImVec2(bb.GetWidth(), 0.0f)); |
|
|
|
|
if (!ItemAdd(bb, NULL)) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
window->DrawList->AddLine(ImVec2(bb.Min.x, bb.Min.y), ImVec2(bb.Min.x, bb.Max.y), GetColorU32(ImGuiCol_Separator)); |
|
|
|
|
|
|
|
|
|
if (g.LogEnabled) |
|
|
|
|
LogText("|"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ImGui::Spacing() |
|
|
|
|