From 6b8a3b25ba861abb8b903ca15eddf18b2d5446d5 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 4 Aug 2018 23:19:35 +0200 Subject: [PATCH] Fix drawing of last frame. --- server/TracyView.cpp | 1 - server/TracyWorker.cpp | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 207433e9..31f42b02 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -6303,7 +6303,6 @@ void View::ZoomToNextFrame() else { frame = m_worker.GetFrameRange( *m_frames, m_zvStart, m_zvStart ).first; - if( frame == -1 ) return; } frame++; if( frame >= m_worker.GetFrameCount( *m_frames ) ) return; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 93c719ac..d655defa 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -889,8 +889,9 @@ int64_t Worker::GetFrameEnd( const FrameData& fd, size_t idx ) const std::pair Worker::GetFrameRange( const FrameData& fd, int64_t from, int64_t to ) { - const auto zitbegin = std::lower_bound( fd.frames.begin(), fd.frames.end(), from ); - if( zitbegin == fd.frames.end() ) return std::make_pair( -1, -1 ); + auto zitbegin = std::lower_bound( fd.frames.begin(), fd.frames.end(), from ); + if( zitbegin == fd.frames.end() ) zitbegin--; + const auto zitend = std::lower_bound( zitbegin, fd.frames.end(), to ); int zbegin = std::distance( fd.frames.begin(), zitbegin );