Fix drawing of last frame.

This commit is contained in:
Bartosz Taudul 2018-08-04 23:19:35 +02:00
parent 3d75eb50bf
commit 6b8a3b25ba
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -889,8 +889,9 @@ int64_t Worker::GetFrameEnd( const FrameData& fd, size_t idx ) const
std::pair <int, int> 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 );