mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-25 21:17:01 +00:00
Internals: Separator: Simplify duplicated code.
This commit is contained in:
parent
a610f1da52
commit
e01fb5462d
@ -1259,21 +1259,14 @@ void ImGui::SeparatorEx(ImGuiSeparatorFlags flags)
|
|||||||
// We don't provide our width to the layout so that it doesn't get feed back into AutoFit
|
// We don't provide our width to the layout so that it doesn't get feed back into AutoFit
|
||||||
const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y + thickness_draw));
|
const ImRect bb(ImVec2(x1, window->DC.CursorPos.y), ImVec2(x2, window->DC.CursorPos.y + thickness_draw));
|
||||||
ItemSize(ImVec2(0.0f, thickness_layout));
|
ItemSize(ImVec2(0.0f, thickness_layout));
|
||||||
if (!ItemAdd(bb, 0))
|
const bool item_visible = ItemAdd(bb, 0);
|
||||||
|
if (item_visible)
|
||||||
{
|
{
|
||||||
if (columns)
|
|
||||||
{
|
|
||||||
PopColumnsBackground();
|
|
||||||
columns->LineMinY = window->DC.CursorPos.y;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x, bb.Min.y), GetColorU32(ImGuiCol_Separator));
|
window->DrawList->AddLine(bb.Min, ImVec2(bb.Max.x, bb.Min.y), GetColorU32(ImGuiCol_Separator));
|
||||||
if (g.LogEnabled)
|
if (g.LogEnabled)
|
||||||
LogRenderedText(&bb.Min, "--------------------------------");
|
LogRenderedText(&bb.Min, "--------------------------------");
|
||||||
|
}
|
||||||
if (columns)
|
if (columns)
|
||||||
{
|
{
|
||||||
PopColumnsBackground();
|
PopColumnsBackground();
|
||||||
|
Loading…
Reference in New Issue
Block a user