diff --git a/profiler/src/profiler/TracyView.cpp b/profiler/src/profiler/TracyView.cpp index 53135edb..1ff1a5d6 100644 --- a/profiler/src/profiler/TracyView.cpp +++ b/profiler/src/profiler/TracyView.cpp @@ -1108,6 +1108,7 @@ bool View::DrawImpl() if( m_showOptions ) DrawOptions(); if( m_showMessages ) DrawMessages(); + if( m_showFlameGraph ) DrawFlameGraph(); if( m_findZone.show ) DrawFindZone(); if( m_showStatistics ) DrawStatistics(); if( m_memInfo.show ) DrawMemory(); @@ -1125,7 +1126,6 @@ bool View::DrawImpl() if( m_sampleParents.symAddr != 0 ) DrawSampleParents(); if( m_showRanges ) DrawRanges(); if( m_showWaitStacks ) DrawWaitStacks(); - if( m_showFlameGraph ) DrawFlameGraph(); if( m_setRangePopup.active ) { diff --git a/profiler/src/profiler/TracyView_FlameGraph.cpp b/profiler/src/profiler/TracyView_FlameGraph.cpp index 6ce66fe3..7ac17f83 100644 --- a/profiler/src/profiler/TracyView_FlameGraph.cpp +++ b/profiler/src/profiler/TracyView_FlameGraph.cpp @@ -123,7 +123,8 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct const auto darkColor = DarkenColor( color ); const auto zsz = x1 - x0; - const char* name = m_worker.GetString( srcloc.name.active ? srcloc.name : srcloc.function ); + const char* slName = m_worker.GetString( srcloc.name.active ? srcloc.name : srcloc.function ); + const char* name = slName; auto tsz = ImGui::CalcTextSize( name ); if( m_vd.shortenName == ShortenName::Always || ( ( m_vd.shortenName == ShortenName::NoSpace || m_vd.shortenName == ShortenName::NoSpaceAndNormalize ) && tsz.x > zsz ) ) @@ -166,6 +167,11 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct TextFocused( "Time:", TimeToString( item.time ) ); if( !item.children.empty() ) TextFocused( "Self time:", TimeToString( self ) ); ImGui::EndTooltip(); + + if( ImGui::IsMouseClicked( 0 ) ) + { + m_findZone.ShowZone( item.srcloc, slName ); + } } uint64_t cts = ts;