diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 9f0b2cff..674fb341 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -924,6 +924,9 @@ bool View::DrawImpl() ImGui::SameLine(); TextDisabledUnformatted( m_notificationText.c_str() ); } + + m_frameHover = -1; + DrawFrames(); DrawZones(); ImGui::End(); @@ -1225,6 +1228,7 @@ void View::DrawFrames() } else { + m_frameHover = sel; if( m_frames->name == 0 ) { const auto offset = m_worker.GetFrameOffset(); @@ -1694,6 +1698,8 @@ bool View::DrawZoneFrames( const FrameData& frames ) { ZoomToRange( fbegin, fend ); } + + if( activeFrameSet ) m_frameHover = i; } if( fsz < MinFrameSize ) @@ -8942,6 +8948,23 @@ void View::DrawInfo() TextFocused( "Count:", RealToString( bins[bin], true ) ); ImGui::EndTooltip(); } + + if( m_frameHover != -1 ) + { + const auto frameTime = m_worker.GetFrameTime( *m_frames, m_frameHover ); + float framePos; + if( m_frameSortData.logTime ) + { + const auto ltmin = log10( tmin ); + const auto ltmax = log10( tmax ); + framePos = round( ( log10( frameTime ) - ltmin ) / float( ltmax - ltmin ) * numBins ); + } + else + { + framePos = round( ( frameTime - tmin ) / float( tmax - tmin ) * numBins ); + } + draw->AddLine( ImVec2( wpos.x + framePos, wpos.y ), ImVec2( wpos.x + framePos, wpos.y+Height-2 ), 0xFFFFFFFF ); + } } } } diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 52a66bfc..3194926a 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -264,6 +264,7 @@ private: const FrameData* m_frames; uint32_t m_lockInfoWindow = InvalidId; ZoneEvent* m_zoneHover = nullptr; + int m_frameHover = -1; Region m_highlight; Region m_highlightZoom;