From 8259816de3004898d1ab4c7bd02d9c0c6d84d241 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 21 Jun 2019 13:08:41 +0200 Subject: [PATCH] Improve playback interruptions on user input. --- server/TracyView.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index a82e6ad8..6f8f4fbb 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -984,7 +984,7 @@ void View::DrawFrames() { m_pause = true; m_zoomAnim.active = false; - m_playback.pause = true; + if( !m_playback.pause && m_playback.sync ) m_playback.pause = true; m_zvStart = m_worker.GetFrameBegin( *m_frames, sel ); m_zvEnd = m_worker.GetFrameEnd( *m_frames, sel + group - 1 ); if( m_zvStart == m_zvEnd ) m_zvStart--; @@ -1110,8 +1110,9 @@ void View::HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, d if( ImGui::IsMouseDragging( 1, 0 ) ) { - m_zoomAnim.active = false; m_pause = true; + m_zoomAnim.active = false; + if( !m_playback.pause && m_playback.sync ) m_playback.pause = true; const auto delta = ImGui::GetMouseDragDelta( 1, 0 ); const auto dpx = int64_t( delta.x * nspx ); if( dpx != 0 ) @@ -9150,9 +9151,8 @@ void View::DrawPlayback() { if( m_playback.sync ) { - const auto start = m_worker.GetFrameBegin( *frameSet, fi->frameRef ); - const auto end = m_worker.GetFrameEnd( *frameSet, fi->frameRef ); - ZoomToRange( start, end ); + m_zvStart = m_worker.GetFrameBegin( *frameSet, fi->frameRef ); + m_zvEnd = m_worker.GetFrameEnd( *frameSet, fi->frameRef ); } } TextFocused( "Timestamp:", TimeToString( tstart - m_worker.GetTimeBegin() ) ); @@ -10219,6 +10219,7 @@ void View::ZoomToRange( int64_t start, int64_t end ) m_pause = true; m_highlightZoom.active = false; + if( !m_playback.pause && m_playback.sync ) m_playback.pause = true; m_zoomAnim.active = true; m_zoomAnim.start0 = m_zvStart; m_zoomAnim.start1 = start;