Tables: Fix for hiding first column (fix fcceff5c + reading PrevLineTextBaseOffset in EndCell of inactive column).

This commit is contained in:
omar 2020-01-06 12:21:15 +01:00 committed by ocornut
parent 164caa2db7
commit 31de161066

View File

@ -1449,6 +1449,7 @@ void ImGui::TableBeginRow(ImGuiTable* table)
table->RowPosY1 = table->RowPosY2 = next_y1; table->RowPosY1 = table->RowPosY2 = next_y1;
table->RowTextBaseline = 0.0f; table->RowTextBaseline = 0.0f;
window->DC.PrevLineTextBaseOffset = 0.0f;
window->DC.CursorMaxPos.y = next_y1; window->DC.CursorMaxPos.y = next_y1;
// Making the header BG color non-transparent will allow us to overlay it multiple times when handling smooth dragging. // Making the header BG color non-transparent will allow us to overlay it multiple times when handling smooth dragging.
@ -1569,6 +1570,7 @@ void ImGui::TableEndRow(ImGuiTable* table)
// [Internal] Called by TableNextRow()TableNextCell()! // [Internal] Called by TableNextRow()TableNextCell()!
// This is called a lot, so we need to be mindful of unnecessary overhead. // This is called a lot, so we need to be mindful of unnecessary overhead.
// FIXME-TABLE FIXME-OPT: Could probably shortcut some things for non-active or clipped columns.
void ImGui::TableBeginCell(ImGuiTable* table, int column_no) void ImGui::TableBeginCell(ImGuiTable* table, int column_no)
{ {
table->CurrentColumn = column_no; table->CurrentColumn = column_no;
@ -1839,7 +1841,7 @@ void ImGui::TableAutoHeaders()
// Open row // Open row
TableNextRow(ImGuiTableRowFlags_Headers, row_height); TableNextRow(ImGuiTableRowFlags_Headers, row_height);
if (window->SkipItems) if (table->HostSkipItems) // Merely an optimization
return; return;
// This for loop is constructed to not make use of internal functions, // This for loop is constructed to not make use of internal functions,
@ -1879,8 +1881,7 @@ void ImGui::TableAutoHeaders()
open_context_popup = column_n; open_context_popup = column_n;
} }
// FIXME-TABLE: This is not user-land code any more... // FIXME-TABLE: This is not user-land code any more + need to explain WHY this is here!
// FIXME-TABLE: Need to explain why this is here!
window->SkipItems = table->HostSkipItems; window->SkipItems = table->HostSkipItems;
// Allow opening popup from the right-most section after the last column // Allow opening popup from the right-most section after the last column