diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 1b3ae2cf..d075408d 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -999,6 +999,8 @@ void View::DrawZones() } while( false ); + m_zvStartNext = 0; + // zones const auto ostep = ImGui::GetFontSize(); int offset = 20; @@ -1012,6 +1014,12 @@ void View::DrawZones() offset += ostep * ( depth + 1.2f ); } + + if( m_zvStartNext != 0 ) + { + m_zvStart = m_zvStartNext; + m_zvEnd = m_zvEndNext; + } } int View::DrawZoneLevel( const Vector& vec, bool hover, double pxns, const ImVec2& wpos, int _offset, int depth ) @@ -1110,6 +1118,12 @@ int View::DrawZoneLevel( const Vector& vec, bool hover, double pxns, con ImGui::Text( "Execution time: %s", TimeToString( end - ev.start ) ); ImGui::Text( "Without profiling: %s", TimeToString( end - ev.start - m_delay ) ); ImGui::EndTooltip(); + + if( ImGui::IsMouseDown( 2 ) && ev.end - ev.start > 0 ) + { + m_zvStartNext = ev.start; + m_zvEndNext = ev.end; + } } if( !ev.child.empty() ) diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 975566f2..e3d66f6d 100755 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -120,6 +120,9 @@ private: int64_t m_zvStart; int64_t m_zvEnd; + int64_t m_zvStartNext; + int64_t m_zvEndNext; + uint64_t m_delay; double m_timerMul; };