From 2852784f556df4645d744313d9dd8ffb05658fc3 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 18 Aug 2018 02:23:55 +0200 Subject: [PATCH] Separate global and level indices for call stack tree. --- server/TracyView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index f4983291..d212aa9a 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6654,9 +6654,11 @@ void View::DrawFrameTreeLevel( std::vector& tree, int& idx ) { auto& io = ImGui::GetIO(); + int lidx = 0; pdqsort_branchless( tree.begin(), tree.end(), [] ( const auto& lhs, const auto& rhs ) { return lhs.allocInclusive > rhs.allocInclusive; } ); for( auto& v : tree ) { + idx++; auto frame = m_worker.GetCallstackFrame( v.frame ); bool expand = false; if( v.children.empty() ) @@ -6667,7 +6669,7 @@ void View::DrawFrameTreeLevel( std::vector& tree, int& idx ) } else { - ImGui::PushID( idx++ ); + ImGui::PushID( lidx++ ); expand = ImGui::TreeNode( m_worker.GetString( frame->name ) ); ImGui::PopID(); }