Skip to content

Commit

Permalink
Tables: Fix for hiding first column (fix fcceff5 + reading PrevLineTe…
Browse files Browse the repository at this point in the history
…xtBaseOffset in EndCell of inactive column). (#2957)
  • Loading branch information
ocornut committed Jan 6, 2020
1 parent 1e156be commit 054d93d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9024,6 +9024,7 @@ void ImGui::TableBeginRow(ImGuiTable* table)

table->RowPosY1 = table->RowPosY2 = next_y1;
table->RowTextBaseline = 0.0f;
window->DC.PrevLineTextBaseOffset = 0.0f;
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.
Expand Down Expand Up @@ -9144,6 +9145,7 @@ void ImGui::TableEndRow(ImGuiTable* table)

// [Internal] Called by TableNextRow()TableNextCell()!
// 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)
{
table->CurrentColumn = column_no;
Expand Down Expand Up @@ -9414,7 +9416,7 @@ void ImGui::TableAutoHeaders()

// Open row
TableNextRow(ImGuiTableRowFlags_Headers, row_height);
if (window->SkipItems)
if (table->HostSkipItems) // Merely an optimization
return;

// This for loop is constructed to not make use of internal functions,
Expand Down Expand Up @@ -9454,8 +9456,7 @@ void ImGui::TableAutoHeaders()
open_context_popup = column_n;
}

// FIXME-TABLE: This is not user-land code any more...
// FIXME-TABLE: Need to explain why this is here!
// FIXME-TABLE: This is not user-land code any more + need to explain WHY this is here!
window->SkipItems = table->HostSkipItems;

// Allow opening popup from the right-most section after the last column
Expand Down

0 comments on commit 054d93d

Please sign in to comment.