MCPcopy Create free account
hub / github.com/RenderKit/embree / NextColumn

Method NextColumn

tutorials/common/imgui/imgui_tables.cpp:3934–3988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3932}
3933
3934void ImGui::NextColumn()
3935{
3936 ImGuiWindow* window = GetCurrentWindow();
3937 if (window->SkipItems || window->DC.CurrentColumns == NULL)
3938 return;
3939
3940 ImGuiContext& g = *GImGui;
3941 ImGuiOldColumns* columns = window->DC.CurrentColumns;
3942
3943 if (columns->Count == 1)
3944 {
3945 window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
3946 IM_ASSERT(columns->Current == 0);
3947 return;
3948 }
3949
3950 // Next column
3951 if (++columns->Current == columns->Count)
3952 columns->Current = 0;
3953
3954 PopItemWidth();
3955
3956 // Optimization: avoid PopClipRect() + SetCurrentChannel() + PushClipRect()
3957 // (which would needlessly attempt to update commands in the wrong channel, then pop or overwrite them),
3958 ImGuiOldColumnData* column = &columns->Columns[columns->Current];
3959 SetWindowClipRectBeforeSetChannel(window, column->ClipRect);
3960 columns->Splitter.SetCurrentChannel(window->DrawList, columns->Current + 1);
3961
3962 const float column_padding = g.Style.ItemSpacing.x;
3963 columns->LineMaxY = ImMax(columns->LineMaxY, window->DC.CursorPos.y);
3964 if (columns->Current > 0)
3965 {
3966 // Columns 1+ ignore IndentX (by canceling it out)
3967 // FIXME-COLUMNS: Unnecessary, could be locked?
3968 window->DC.ColumnsOffset.x = GetColumnOffset(columns->Current) - window->DC.Indent.x + column_padding;
3969 }
3970 else
3971 {
3972 // New row/line: column 0 honor IndentX.
3973 window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
3974 window->DC.IsSameLine = false;
3975 columns->LineMinY = columns->LineMaxY;
3976 }
3977 window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
3978 window->DC.CursorPos.y = columns->LineMinY;
3979 window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
3980 window->DC.CurrLineTextBaseOffset = 0.0f;
3981
3982 // FIXME-COLUMNS: Share code with BeginColumns() - move code on columns setup.
3983 float offset_0 = GetColumnOffset(columns->Current);
3984 float offset_1 = GetColumnOffset(columns->Current + 1);
3985 float width = offset_1 - offset_0;
3986 PushItemWidth(width * 0.65f);
3987 window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
3988}
3989
3990void ImGui::EndColumns()
3991{

Callers

nothing calls this directly

Calls 4

GetCurrentWindowFunction · 0.85
ImMaxFunction · 0.85
ImVec2Function · 0.85
SetCurrentChannelMethod · 0.80

Tested by

no test coverage detected