MCPcopy Create free account
hub / github.com/cinder/Cinder / TableBeginCell

Method TableBeginCell

src/imgui/imgui_tables.cpp:2172–2225  ·  view source on GitHub ↗

[Internal] Called by TableSetColumnIndex()/TableNextColumn() This is called very frequently, so we need to be mindful of unnecessary overhead. FIXME-TABLE FIXME-OPT: Could probably shortcut some things for non-active or clipped columns.

Source from the content-addressed store, hash-verified

2170// This is called very frequently, so we need to be mindful of unnecessary overhead.
2171// FIXME-TABLE FIXME-OPT: Could probably shortcut some things for non-active or clipped columns.
2172void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
2173{
2174 ImGuiContext& g = *GImGui;
2175 ImGuiTableColumn* column = &table->Columns[column_n];
2176 ImGuiWindow* window = table->InnerWindow;
2177 table->CurrentColumn = column_n;
2178
2179 // Start position is roughly ~~ CellRect.Min + CellPadding + Indent
2180 float start_x = column->WorkMinX;
2181 if (column->Flags & ImGuiTableColumnFlags_IndentEnable)
2182 start_x += table->RowIndentOffsetX; // ~~ += window.DC.Indent.x - table->HostIndentX, except we locked it for the row.
2183
2184 window->DC.CursorPos.x = start_x;
2185 window->DC.CursorPos.y = table->RowPosY1 + table->RowCellPaddingY;
2186 window->DC.CursorMaxPos.x = window->DC.CursorPos.x;
2187 window->DC.ColumnsOffset.x = start_x - window->Pos.x - window->DC.Indent.x; // FIXME-WORKRECT
2188 window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x; // PrevLine.y is preserved. This allows users to call SameLine() to share LineSize between columns.
2189 window->DC.CurrLineTextBaseOffset = table->RowTextBaseline;
2190 window->DC.NavLayerCurrent = (ImGuiNavLayer)column->NavLayerCurrent;
2191
2192 // Note how WorkRect.Max.y is only set once during layout
2193 window->WorkRect.Min.y = window->DC.CursorPos.y;
2194 window->WorkRect.Min.x = column->WorkMinX;
2195 window->WorkRect.Max.x = column->WorkMaxX;
2196 window->DC.ItemWidth = column->ItemWidth;
2197
2198 window->SkipItems = column->IsSkipItems;
2199 if (column->IsSkipItems)
2200 {
2201 g.LastItemData.ID = 0;
2202 g.LastItemData.StatusFlags = 0;
2203 }
2204
2205 // Also see TablePushColumnChannel()
2206 if (table->Flags & ImGuiTableFlags_NoClip)
2207 {
2208 // FIXME: if we end up drawing all borders/bg in EndTable, could remove this and just assert that channel hasn't changed.
2209 table->DrawSplitter->SetCurrentChannel(window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP);
2210 //IM_ASSERT(table->DrawSplitter._Current == TABLE_DRAW_CHANNEL_NOCLIP);
2211 }
2212 else
2213 {
2214 // FIXME-TABLE: Could avoid this if draw channel is dummy channel?
2215 SetWindowClipRectBeforeSetChannel(window, column->ClipRect);
2216 table->DrawSplitter->SetCurrentChannel(window->DrawList, column->DrawChannelCurrent);
2217 }
2218
2219 // Logging
2220 if (g.LogEnabled && !column->IsSkipItems)
2221 {
2222 LogRenderedText(&window->DC.CursorPos, "|");
2223 g.LogLinePosY = FLT_MAX;
2224 }
2225}
2226
2227// [Internal] Called by TableNextRow()/TableSetColumnIndex()/TableNextColumn()
2228void ImGui::TableEndCell(ImGuiTable* table)

Callers

nothing calls this directly

Calls 1

SetCurrentChannelMethod · 0.80

Tested by

no test coverage detected