Skip to content
Permalink
Browse files

Correctly clamp frame numbers so that invalid frames are not possible

  • Loading branch information
nyalldawson committed Mar 12, 2020
1 parent fb13b0f commit 6eaefb66858182e2bf4fcce5da9dcd3290b61f4a
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/qgstemporalnavigationobject.cpp
@@ -81,7 +81,7 @@ void QgsTemporalNavigationObject::setCurrentFrameNumber( long long frameNumber )
{
if ( mCurrentFrameNumber != frameNumber )
{
mCurrentFrameNumber = frameNumber;
mCurrentFrameNumber = std::max( 0LL, std::min( frameNumber, totalFrameCount() - 1 ) );
QgsDateTimeRange range = dateTimeRangeForFrameNumber( mCurrentFrameNumber );
emit updateTemporalRange( range );
}
@@ -157,7 +157,7 @@ void QgsTemporalNavigationObject::rewindToStart()

void QgsTemporalNavigationObject::skipToEnd()
{
const long long frame = totalFrameCount();
const long long frame = totalFrameCount() - 1;
setCurrentFrameNumber( frame );
}

0 comments on commit 6eaefb6

Please sign in to comment.
You can’t perform that action at this time.