diff --git a/imgui_internal.h b/imgui_internal.h index 57851e7ee..995d9654a 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -3281,6 +3281,7 @@ struct IMGUI_API ImGuiTableTempData ImVec1 HostBackupColumnsOffset; // Backup of OuterWindow->DC.ColumnsOffset at the end of BeginTable() float HostBackupItemWidth; // Backup of OuterWindow->DC.ItemWidth at the end of BeginTable() int HostBackupItemWidthStackSize;//Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable() + ImGuiLayoutType HostBackupLayoutType; // Backup of InnerWindow->DC.LayoutType at the end of BeginTable() ImGuiTableTempData() { memset((void*)this, 0, sizeof(*this)); LastTimeActive = -1.0f; } }; diff --git a/imgui_tables.cpp b/imgui_tables.cpp index f7a39f689..587cfe4c8 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -476,7 +476,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG temp_data->HostBackupCursorMaxPos = inner_window->DC.CursorMaxPos; temp_data->HostBackupItemWidth = outer_window->DC.ItemWidth; temp_data->HostBackupItemWidthStackSize = outer_window->DC.ItemWidthStack.Size; + temp_data->HostBackupLayoutType = inner_window->DC.LayoutType; inner_window->DC.PrevLineSize = inner_window->DC.CurrLineSize = ImVec2(0.0f, 0.0f); + inner_window->DC.LayoutType = ImGuiLayoutType_Vertical; // Border size // FIXME-WIP: Changing this is not currently simple due to ClipRect requirements. Easier to manage with new 1.93 primitives though. @@ -1486,6 +1488,7 @@ void ImGui::EndTable() // Finalize table height ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); inner_window->DC.PrevLineSize = temp_data->HostBackupPrevLineSize; + inner_window->DC.LayoutType = temp_data->HostBackupLayoutType; inner_window->DC.CurrLineSize = temp_data->HostBackupCurrLineSize; inner_window->DC.CursorMaxPos = temp_data->HostBackupCursorMaxPos; const float inner_content_max_y = ImCeil(table->RowPosY2); // Rounding final position is important as we currently don't round row height ('Demo->Tables->Outer Size' demo uses non-integer heights)