From 3dd14c9e019efa3d4719f14ac28ccb36211abeb0 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 4 Mar 2018 23:07:38 +0100 Subject: [PATCH] Filter found zones according to selection. --- server/TracyView.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 16b09c55..cb88166e 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3034,6 +3034,16 @@ void View::DrawFindZone() for( auto& ev : v->timeline ) { + const auto end = m_worker.GetZoneEnd( *ev ); + const auto timespan = end - ev->start; + + if( m_findZone.highlight.active ) + { + const auto s = std::min( m_findZone.highlight.start, m_findZone.highlight.end ); + const auto e = std::max( m_findZone.highlight.start, m_findZone.highlight.end ); + if( timespan < s || timespan > e ) continue; + } + ImGui::PushID( ev ); auto& srcloc = m_worker.GetSourceLocation( ev->srcloc ); @@ -3055,8 +3065,7 @@ void View::DrawFindZone() ImGui::Text( TimeToString( ev->start - m_worker.GetFrameBegin( 0 ) ) ); ImGui::NextColumn(); - const auto end = m_worker.GetZoneEnd( *ev ); - ImGui::Text( TimeToString( end - ev->start ) ); + ImGui::Text( TimeToString( timespan ) ); ImGui::NextColumn(); ImGui::PopID();