mirror of
https://github.com/wolfpld/tracy
synced 2025-04-30 04:43:53 +00:00
Fix division by zero.
This commit is contained in:
parent
555203c46a
commit
b55fa19f72
@ -5873,8 +5873,11 @@ void View::DrawZoneInfoWindow()
|
|||||||
if( m_worker.AreSourceLocationZonesReady() )
|
if( m_worker.AreSourceLocationZonesReady() )
|
||||||
{
|
{
|
||||||
auto& zoneData = m_worker.GetZonesForSourceLocation( ev.SrcLoc() );
|
auto& zoneData = m_worker.GetZonesForSourceLocation( ev.SrcLoc() );
|
||||||
ImGui::SameLine();
|
if( zoneData.total > 0 )
|
||||||
ImGui::TextDisabled( "(%.2f%% of average time)", float( ztime ) / zoneData.total * zoneData.zones.size() * 100 );
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::TextDisabled( "(%.2f%% of average time)", float( ztime ) / zoneData.total * zoneData.zones.size() * 100 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
TextFocused( "Self time:", TimeToString( selftime ) );
|
TextFocused( "Self time:", TimeToString( selftime ) );
|
||||||
@ -13955,8 +13958,11 @@ void View::ZoneTooltip( const ZoneEvent& ev )
|
|||||||
if( m_worker.AreSourceLocationZonesReady() )
|
if( m_worker.AreSourceLocationZonesReady() )
|
||||||
{
|
{
|
||||||
auto& zoneData = m_worker.GetZonesForSourceLocation( ev.SrcLoc() );
|
auto& zoneData = m_worker.GetZonesForSourceLocation( ev.SrcLoc() );
|
||||||
ImGui::SameLine();
|
if( zoneData.total > 0 )
|
||||||
ImGui::TextDisabled( "(%.2f%% of average time)", float( ztime ) / zoneData.total * zoneData.zones.size() * 100 );
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::TextDisabled( "(%.2f%% of average time)", float( ztime ) / zoneData.total * zoneData.zones.size() * 100 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
TextFocused( "Self time:", TimeToString( selftime ) );
|
TextFocused( "Self time:", TimeToString( selftime ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user