From 31de16106632bdf93763653fa9f3e71621aff883 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 6 Jan 2020 12:21:15 +0100 Subject: [PATCH] Tables: Fix for hiding first column (fix fcceff5c + reading PrevLineTextBaseOffset in EndCell of inactive column). --- imgui_tables.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 24519c977..b3958d23d 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -1449,6 +1449,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. @@ -1569,6 +1570,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; @@ -1839,7 +1841,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, @@ -1879,8 +1881,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