Don't draw unneeded separator.

This commit is contained in:
Bartosz Taudul 2019-11-15 20:04:59 +01:00
parent 5f0cab6b63
commit 49e3bc8b21

View File

@ -10697,11 +10697,12 @@ void View::DrawMemoryAllocWindow()
TextFocused( "Duration:", TimeToString( ev.TimeFree() - ev.TimeAlloc() ) );
}
ImGui::Separator();
bool sep = false;
auto zoneAlloc = FindZoneAtTime( tidAlloc, ev.TimeAlloc() );
if( zoneAlloc )
{
ImGui::Separator();
sep = true;
const auto& srcloc = m_worker.GetSourceLocation( zoneAlloc->SrcLoc() );
const auto txt = srcloc.name.active ? m_worker.GetString( srcloc.name ) : m_worker.GetString( srcloc.function );
ImGui::PushID( idx++ );
@ -10728,6 +10729,7 @@ void View::DrawMemoryAllocWindow()
auto zoneFree = FindZoneAtTime( tidFree, ev.TimeFree() );
if( zoneFree )
{
if( !sep ) ImGui::Separator();
const auto& srcloc = m_worker.GetSourceLocation( zoneFree->SrcLoc() );
const auto txt = srcloc.name.active ? m_worker.GetString( srcloc.name ) : m_worker.GetString( srcloc.function );
TextFocused( "Zone free:", txt );
@ -10745,14 +10747,13 @@ void View::DrawMemoryAllocWindow()
}
ZoneTooltip( *zoneFree );
}
}
if( zoneAlloc != 0 && zoneAlloc == zoneFree )
{
ImGui::SameLine();
TextDisabledUnformatted( "(same zone)" );
}
}
}
ImGui::End();
if( !show ) m_memoryAllocInfoWindow = -1;