More navigation extraction.

This commit is contained in:
Bartosz Taudul
2022-07-02 13:43:46 +02:00
parent 10dbefefab
commit 7ed1c4ffb1
2 changed files with 19 additions and 19 deletions

View File

@@ -130,4 +130,23 @@ void View::CenterAtTime( int64_t t )
ZoomToRange( t - hr, t + hr );
}
void View::SetViewToLastFrames()
{
const int total = m_worker.GetFrameCount( *m_frames );
m_vd.zvStart = m_worker.GetFrameBegin( *m_frames, std::max( 0, total - 4 ) );
if( total == 1 )
{
m_vd.zvEnd = m_worker.GetLastTime();
}
else
{
m_vd.zvEnd = m_worker.GetFrameBegin( *m_frames, total - 1 );
}
if( m_vd.zvEnd == m_vd.zvStart )
{
m_vd.zvEnd = m_worker.GetLastTime();
}
}
}