From 1fa778891c1a4725ef6b38785acdba7a2a673ae8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 26 Sep 2017 22:08:58 +0200 Subject: [PATCH] Allow zooming to collapsed zones. --- server/TracyView.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 2a6cc2f2..585b3e61 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1070,6 +1070,12 @@ int View::DrawZoneLevel( const Vector& vec, bool hover, double pxns, con ImGui::Text( "Zones too small to display: %i", num ); ImGui::Text( "Execution time: %s", TimeToString( rend - ev.start ) ); ImGui::EndTooltip(); + + if( ImGui::IsMouseClicked( 2 ) && rend - ev.start > 0 ) + { + m_zvStartNext = ev.start; + m_zvEndNext = rend; + } } } else @@ -1120,7 +1126,7 @@ int View::DrawZoneLevel( const Vector& vec, bool hover, double pxns, con ImGui::Text( "Without profiling: %s", TimeToString( end - ev.start - m_delay ) ); ImGui::EndTooltip(); - if( ImGui::IsMouseDown( 2 ) && ev.end - ev.start > 0 ) + if( m_zvStartNext == 0 && ImGui::IsMouseClicked( 2 ) && ev.end - ev.start > 0 ) { m_zvStartNext = ev.start; m_zvEndNext = ev.end;