From 84d0f1a3eafbcc934979b52d8eeb673197009ee1 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 17 Jul 2018 23:17:46 +0200 Subject: [PATCH] Indicate inspected memory address on alloc list. --- server/TracyView.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index d968f042..85783414 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -5316,10 +5316,21 @@ void View::ListMemData( T ptr, T end, std::function DrawAddress, const while( ptr != end ) { auto v = *ptr; - DrawAddress( ptr ); - if( ImGui::IsItemClicked() ) + const auto arrIdx = std::distance( mem.data.begin(), v ); + + if( m_memoryAllocInfoWindow == arrIdx ) { - m_memoryAllocInfoWindow = std::distance( mem.data.begin(), v ); + ImGui::PushStyleColor( ImGuiCol_Text, ImVec4( 1.f, 0.f, 0.f, 1.f ) ); + DrawAddress( ptr ); + ImGui::PopStyleColor(); + } + else + { + DrawAddress( ptr ); + if( ImGui::IsItemClicked() ) + { + m_memoryAllocInfoWindow = arrIdx; + } } ImGui::NextColumn(); ImGui::Text( "%s", RealToString( v->size, true ) );