From 89afbd1aefe0c65244561e0740233ed50a58f60a Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 19 Nov 2020 21:59:27 +0100 Subject: [PATCH] Fixed pattern data view not rendering at all --- source/views/view_pattern_data.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/source/views/view_pattern_data.cpp b/source/views/view_pattern_data.cpp index 8a4fe8214..40e45bef5 100644 --- a/source/views/view_pattern_data.cpp +++ b/source/views/view_pattern_data.cpp @@ -41,8 +41,6 @@ namespace hex { sortSpecs->SpecsDirty = false; } - ImGui::TableHeadersRow(); - return true; } @@ -59,11 +57,17 @@ namespace hex { if (this->m_dataProvider != nullptr && this->m_dataProvider->isReadable()) { if (beginPatternDataTable(this->m_dataProvider, this->m_patternData, this->m_sortedPatternData)) { - u32 rowCount = 0; - for (auto& patternData : this->m_sortedPatternData) { - patternData->createEntry(this->m_dataProvider); - ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, ((rowCount % 2) == 0) ? 0xFF101010 : 0xFF303030); - rowCount++; + if (this->m_sortedPatternData.size() > 0) { + ImGui::TableHeadersRow(); + + u32 rowCount = 0; + for (auto &patternData : this->m_sortedPatternData) { + patternData->createEntry(this->m_dataProvider); + ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, + ((rowCount % 2) == 0) ? 0xFF101010 : 0xFF303030); + rowCount++; + } + } ImGui::EndTable();