From 17afcbce4fa09f41ca866f844fa595f18108483e Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 28 Dec 2019 17:50:54 +0100 Subject: [PATCH] Highlight zone from zone list on histogram. --- server/TracyView.cpp | 7 +++++-- server/TracyView.hpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index de0a7170..4d81efcf 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2056,6 +2056,7 @@ void View::DrawZones() m_drawThreadHighlight.Decay( 0 ); m_cpuDataThread.Decay( 0 ); m_zoneHover = nullptr; + m_zoneHover2.Decay( nullptr ); if( m_vd.zvStart == m_vd.zvEnd ) return; assert( m_vd.zvStart < m_vd.zvEnd ); @@ -9051,9 +9052,10 @@ void View::DrawFindZone() draw->PopClipRect(); } - if( m_zoneHover && m_findZone.match[m_findZone.selMatch] == m_zoneHover->SrcLoc() ) + if( ( m_zoneHover && m_findZone.match[m_findZone.selMatch] == m_zoneHover->SrcLoc() ) || + ( m_zoneHover2 && m_findZone.match[m_findZone.selMatch] == m_zoneHover2->SrcLoc() ) ) { - const auto zoneTime = m_worker.GetZoneEnd( *m_zoneHover ) - m_zoneHover->Start(); + const auto zoneTime = m_zoneHover ? ( m_worker.GetZoneEnd( *m_zoneHover ) - m_zoneHover->Start() ) : ( m_worker.GetZoneEnd( *m_zoneHover2 ) - m_zoneHover2->Start() ); float zonePos; if( m_findZone.logTime ) { @@ -9527,6 +9529,7 @@ void View::DrawZoneList( const Vector>& zones ) ZoomToZone( *ev ); } ZoneTooltip( *ev ); + m_zoneHover2 = ev; } ImGui::NextColumn(); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 96be0488..f0cbcbb7 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -301,6 +301,7 @@ private: const FrameData* m_frames; uint32_t m_lockInfoWindow = InvalidId; const ZoneEvent* m_zoneHover = nullptr; + DecayValue m_zoneHover2 = nullptr; int m_frameHover = -1; bool m_messagesScrollBottom; ImGuiTextFilter m_messageFilter;