[Internal] Called by TableNextRow()/TableSetColumnIndex()/TableNextColumn()
| 2057 | |
| 2058 | // [Internal] Called by TableNextRow()/TableSetColumnIndex()/TableNextColumn() |
| 2059 | void ImGui::TableEndCell(ImGuiTable* table) |
| 2060 | { |
| 2061 | ImGuiTableColumn* column = &table->Columns[table->CurrentColumn]; |
| 2062 | ImGuiWindow* window = table->InnerWindow; |
| 2063 | |
| 2064 | if (window->DC.IsSetPos) |
| 2065 | ErrorCheckUsingSetCursorPosToExtendParentBoundaries(); |
| 2066 | |
| 2067 | // Report maximum position so we can infer content size per column. |
| 2068 | float* p_max_pos_x; |
| 2069 | if (table->RowFlags & ImGuiTableRowFlags_Headers) |
| 2070 | p_max_pos_x = &column->ContentMaxXHeadersUsed; // Useful in case user submit contents in header row that is not a TableHeader() call |
| 2071 | else |
| 2072 | p_max_pos_x = table->IsUnfrozenRows ? &column->ContentMaxXUnfrozen : &column->ContentMaxXFrozen; |
| 2073 | *p_max_pos_x = ImMax(*p_max_pos_x, window->DC.CursorMaxPos.x); |
| 2074 | if (column->IsEnabled) |
| 2075 | table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->RowCellPaddingY); |
| 2076 | column->ItemWidth = window->DC.ItemWidth; |
| 2077 | |
| 2078 | // Propagate text baseline for the entire row |
| 2079 | // FIXME-TABLE: Here we propagate text baseline from the last line of the cell.. instead of the first one. |
| 2080 | table->RowTextBaseline = ImMax(table->RowTextBaseline, window->DC.PrevLineTextBaseOffset); |
| 2081 | } |
| 2082 | |
| 2083 | //------------------------------------------------------------------------- |
| 2084 | // [SECTION] Tables: Columns width management |