@@ -452,7 +452,6 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
452
452
table->CellSpacingX1 = inner_spacing_explicit + inner_spacing_for_border;
453
453
table->CellSpacingX2 = inner_spacing_explicit;
454
454
table->CellPaddingX = inner_padding_explicit;
455
- table->CellPaddingY = g.Style .CellPadding .y ;
456
455
457
456
const float outer_padding_for_border = (flags & ImGuiTableFlags_BordersOuterV) ? TABLE_BORDER_SIZE : 0 .0f ;
458
457
const float outer_padding_explicit = pad_outer_x ? g.Style .CellPadding .x : 0 .0f ;
@@ -469,6 +468,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
469
468
470
469
table->RowPosY1 = table->RowPosY2 = table->WorkRect .Min .y ; // This is needed somehow
471
470
table->RowTextBaseline = 0 .0f ; // This will be cleared again by TableBeginRow()
471
+ table->RowCellPaddingY = 0 .0f ;
472
472
table->FreezeRowsRequest = table->FreezeRowsCount = 0 ; // This will be setup by TableSetupScrollFreeze(), if any
473
473
table->FreezeColumnsRequest = table->FreezeColumnsCount = 0 ;
474
474
table->IsUnfrozenRows = true ;
@@ -1745,22 +1745,22 @@ void ImGui::TableNextRow(ImGuiTableRowFlags row_flags, float row_min_height)
1745
1745
1746
1746
table->LastRowFlags = table->RowFlags ;
1747
1747
table->RowFlags = row_flags;
1748
+ table->RowCellPaddingY = g.Style .CellPadding .y ;
1748
1749
table->RowMinHeight = row_min_height;
1749
1750
TableBeginRow (table);
1750
1751
1751
1752
// We honor min_row_height requested by user, but cannot guarantee per-row maximum height,
1752
1753
// because that would essentially require a unique clipping rectangle per-cell.
1753
- table->RowPosY2 += table->CellPaddingY * 2 .0f ;
1754
+ table->RowPosY2 += table->RowCellPaddingY * 2 .0f ;
1754
1755
table->RowPosY2 = ImMax (table->RowPosY2 , table->RowPosY1 + row_min_height);
1755
1756
1756
1757
// Disable output until user calls TableNextColumn()
1757
1758
table->InnerWindow ->SkipItems = true ;
1758
1759
}
1759
1760
1760
- // [Internal] Called by TableNextRow()
1761
+ // [Internal] Only called by TableNextRow()
1761
1762
void ImGui::TableBeginRow (ImGuiTable* table)
1762
1763
{
1763
- ImGuiContext& g = *GImGui;
1764
1764
ImGuiWindow* window = table->InnerWindow ;
1765
1765
IM_ASSERT (!table->IsInsideRow );
1766
1766
@@ -1779,10 +1779,9 @@ void ImGui::TableBeginRow(ImGuiTable* table)
1779
1779
table->RowPosY1 = table->RowPosY2 = next_y1;
1780
1780
table->RowTextBaseline = 0 .0f ;
1781
1781
table->RowIndentOffsetX = window->DC .Indent .x - table->HostIndentX ; // Lock indent
1782
- table->CellPaddingY = g.Style .CellPadding .y ;
1783
1782
1784
1783
window->DC .PrevLineTextBaseOffset = 0 .0f ;
1785
- window->DC .CursorPosPrevLine = ImVec2 (window->DC .CursorPos .x , window->DC .CursorPos .y + table->CellPaddingY ); // This allows users to call SameLine() to share LineSize between columns.
1784
+ window->DC .CursorPosPrevLine = ImVec2 (window->DC .CursorPos .x , window->DC .CursorPos .y + table->RowCellPaddingY ); // This allows users to call SameLine() to share LineSize between columns.
1786
1785
window->DC .PrevLineSize = window->DC .CurrLineSize = ImVec2 (0 .0f , 0 .0f ); // This allows users to call SameLine() to share LineSize between columns, and to call it from first column too.
1787
1786
window->DC .IsSameLine = window->DC .IsSetPos = false ;
1788
1787
window->DC .CursorMaxPos .y = next_y1;
@@ -2017,7 +2016,7 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
2017
2016
start_x += table->RowIndentOffsetX ; // ~~ += window.DC.Indent.x - table->HostIndentX, except we locked it for the row.
2018
2017
2019
2018
window->DC .CursorPos .x = start_x;
2020
- window->DC .CursorPos .y = table->RowPosY1 + table->CellPaddingY ;
2019
+ window->DC .CursorPos .y = table->RowPosY1 + table->RowCellPaddingY ;
2021
2020
window->DC .CursorMaxPos .x = window->DC .CursorPos .x ;
2022
2021
window->DC .ColumnsOffset .x = start_x - window->Pos .x - window->DC .Indent .x ; // FIXME-WORKRECT
2023
2022
window->DC .CursorPosPrevLine .x = window->DC .CursorPos .x ; // PrevLine.y is preserved. This allows users to call SameLine() to share LineSize between columns.
@@ -2075,7 +2074,7 @@ void ImGui::TableEndCell(ImGuiTable* table)
2075
2074
p_max_pos_x = table->IsUnfrozenRows ? &column->ContentMaxXUnfrozen : &column->ContentMaxXFrozen ;
2076
2075
*p_max_pos_x = ImMax (*p_max_pos_x, window->DC .CursorMaxPos .x );
2077
2076
if (column->IsEnabled )
2078
- table->RowPosY2 = ImMax (table->RowPosY2 , window->DC .CursorMaxPos .y + table->CellPaddingY );
2077
+ table->RowPosY2 = ImMax (table->RowPosY2 , window->DC .CursorMaxPos .y + table->RowCellPaddingY );
2079
2078
column->ItemWidth = window->DC .ItemWidth ;
2080
2079
2081
2080
// Propagate text baseline for the entire row
@@ -2957,7 +2956,7 @@ void ImGui::TableHeader(const char* label)
2957
2956
// If we already got a row height, there's use that.
2958
2957
// FIXME-TABLE: Padding problem if the correct outer-padding CellBgRect strays off our ClipRect?
2959
2958
ImRect cell_r = TableGetCellBgRect (table, column_n);
2960
- float label_height = ImMax (label_size.y , table->RowMinHeight - table->CellPaddingY * 2 .0f );
2959
+ float label_height = ImMax (label_size.y , table->RowMinHeight - table->RowCellPaddingY * 2 .0f );
2961
2960
2962
2961
// Calculate ideal size for sort order arrow
2963
2962
float w_arrow = 0 .0f ;
0 commit comments