From c23eb2f7fb9787dbb18891ed55a6a13dbd0fb34b Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 6 Dec 2020 23:10:05 +0100 Subject: [PATCH] Limit table size to 14 elements. --- server/TracyView.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index c25d9b23..02202dd0 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -7191,8 +7191,9 @@ void View::DrawZoneInfoWindow() ImGui::SameLine(); SmallCheckbox( "Time relative to zone start", &m_ctxSwitchTimeRelativeToZone ); const int64_t adjust = m_ctxSwitchTimeRelativeToZone ? ev.Start() : 0; + const auto wrsz = eit - bit; - ImGui::BeginTable( "##waitregions", 6, ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg ); + ImGui::BeginTable( "##waitregions", 6, ImGuiTableFlags_Resizable | ImGuiTableFlags_ScrollY | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg, ImVec2( 0, ImGui::GetTextLineHeightWithSpacing() * std::min( 1+wrsz, 15 ) ) ); ImGui::TableSetupScrollFreeze( 0, 1 ); ImGui::TableSetupColumn( "Begin" ); ImGui::TableSetupColumn( "End" ); @@ -7201,7 +7202,7 @@ void View::DrawZoneInfoWindow() ImGui::TableSetupColumn( "CPU" ); ImGui::TableSetupColumn( "State" ); ImGui::TableHeadersRow(); - const auto wrsz = eit - bit; + ImGuiListClipper clipper; clipper.Begin( wrsz ); while( clipper.Step() ) @@ -7463,7 +7464,7 @@ void View::DrawZoneInfoWindow() { ImGui::SameLine(); SmallCheckbox( "Time relative to zone start", &m_messageTimeRelativeToZone ); - ImGui::BeginTable( "##waitregions", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersInnerV ); + ImGui::BeginTable( "##waitregions", 2, ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersInnerV, ImVec2( 0, ImGui::GetTextLineHeightWithSpacing() * std::min( msgend-msgit+1, 15 ) ) ); ImGui::TableSetupScrollFreeze( 0, 1 ); ImGui::TableSetupColumn( "Time", ImGuiTableColumnFlags_WidthAutoResize ); ImGui::TableSetupColumn( "Message" );