Indicate inspected memory address on alloc list.

This commit is contained in:
Bartosz Taudul 2018-07-17 23:17:46 +02:00
parent cf3bf4378b
commit 84d0f1a3ea

View File

@ -5316,10 +5316,21 @@ void View::ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const
while( ptr != end ) while( ptr != end )
{ {
auto v = *ptr; auto v = *ptr;
const auto arrIdx = std::distance( mem.data.begin(), v );
if( m_memoryAllocInfoWindow == arrIdx )
{
ImGui::PushStyleColor( ImGuiCol_Text, ImVec4( 1.f, 0.f, 0.f, 1.f ) );
DrawAddress( ptr );
ImGui::PopStyleColor();
}
else
{
DrawAddress( ptr ); DrawAddress( ptr );
if( ImGui::IsItemClicked() ) if( ImGui::IsItemClicked() )
{ {
m_memoryAllocInfoWindow = std::distance( mem.data.begin(), v ); m_memoryAllocInfoWindow = arrIdx;
}
} }
ImGui::NextColumn(); ImGui::NextColumn();
ImGui::Text( "%s", RealToString( v->size, true ) ); ImGui::Text( "%s", RealToString( v->size, true ) );