1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Display ghost zones by default, if no instrumented zones.

This commit is contained in:
Bartosz Taudul 2020-03-19 00:42:20 +01:00
parent e11bf1d62d
commit a2bf5ac199

View File

@ -2545,7 +2545,7 @@ void View::DrawZones()
if( m_vd.drawZones )
{
#ifndef TRACY_NO_STATISTICS
if( vis.ghost )
if( vis.ghost || ( m_vd.ghostZones && v->timeline.empty() ) )
{
depth = DispatchGhostLevel( v->ghostZones, hover, pxns, int64_t( nspx ), wpos, offset, 0, yMin, yMax, v->id );
}
@ -2725,7 +2725,7 @@ void View::DrawZones()
#ifndef TRACY_NO_STATISTICS
const bool hasGhostZones = showFull && m_worker.AreGhostZonesReady() && !v->ghostZones.empty();
float ghostSz;
if( hasGhostZones )
if( hasGhostZones && !v->timeline.empty() )
{
auto& vis = Vis( v );
const auto color = vis.ghost ? 0xFFAA9999 : 0x88AA7777;
@ -2742,7 +2742,7 @@ void View::DrawZones()
if( hover )
{
#ifndef TRACY_NO_STATISTICS
if( hasGhostZones && ImGui::IsMouseHoveringRect( wpos + ImVec2( 1.5f * ty + txtsz.x, oldOffset ), wpos + ImVec2( 1.5f * ty + txtsz.x + ghostSz, oldOffset + ty ) ) )
if( hasGhostZones && !v->timeline.empty() && ImGui::IsMouseHoveringRect( wpos + ImVec2( 1.5f * ty + txtsz.x, oldOffset ), wpos + ImVec2( 1.5f * ty + txtsz.x + ghostSz, oldOffset + ty ) ) )
{
if( ImGui::IsMouseClicked( 0 ) )
{