From 34aecee1f93e45514741b3e0b4d8d8bdeec76c04 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 23 Sep 2017 00:46:15 +0200 Subject: [PATCH] Zone span selection in frame view. --- server/TracyView.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 4d4b5870..e2bd647a 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -662,6 +662,19 @@ void View::DrawFrames() } ImGui::Text( "Time from start of program: %s", TimeToString( m_frames[sel] - m_frames[0] ) ); ImGui::EndTooltip(); + + if( ImGui::IsMouseClicked( 0 ) ) + { + m_pause = true; + m_zvStart = GetFrameBegin( sel ); + m_zvEnd = GetFrameEnd( sel + group - 1 ); + if( m_zvStart == m_zvEnd ) m_zvStart--; + } + else if( ImGui::IsMouseDragging( 0 ) ) + { + m_zvStart = std::min( m_zvStart, (int64_t)GetFrameBegin( sel ) ); + m_zvEnd = std::max( m_zvEnd, (int64_t)GetFrameEnd( sel + group - 1 ) ); + } } if( m_pause && wheel != 0 )