From 46ed2fb8025b4f126292bb81070ab18c62e5cdc4 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 28 Dec 2019 17:28:39 +0100 Subject: [PATCH] Enhance time distribution zone search. When the find zone menu is opened from the zone time distribution list, time range limit will be enabled, preventing display of zones outside of the selected zone range. This allows much easier finding of child zones within the selected zone scope. Limiting zone search to a specified thread(s) might also be helpful here, but it can be worked around by looking only at zones in a single thread group. --- server/TracyView.cpp | 2 +- server/TracyView.hpp | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 3f587d65..de0a7170 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6397,7 +6397,7 @@ void View::DrawZoneInfoWindow() const auto name = m_worker.GetZoneName( sl ); if( ImGui::Selectable( name, false, ImGuiSelectableFlags_SpanAllColumns ) ) { - m_findZone.ShowZone( v->first, name ); + m_findZone.ShowZone( v->first, name, ev.Start(), m_worker.GetZoneEnd( ev ) ); } ImGui::SameLine(); ImGui::TextDisabled( "(\xc3\x97%s)", RealToString( v->second.count, true ) ); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index feb7c397..96be0488 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -497,6 +497,19 @@ private: void ShowZone( int16_t srcloc, const char* name ) { show = true; + limitRange = false; + Reset(); + match.emplace_back( srcloc ); + strcpy( pattern, name ); + } + + void ShowZone( int16_t srcloc, const char* name, int64_t limitMin, int64_t limitMax ) + { + assert( limitMin <= limitMax ); + show = true; + limitRange = true; + rangeMin = limitMin; + rangeMax = limitMax; Reset(); match.emplace_back( srcloc ); strcpy( pattern, name );