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