Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Minor fixes to temporal navigation object logic
  • Loading branch information
nyalldawson committed Mar 12, 2020
1 parent f58e465 commit 2e07961
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/core/qgstemporalnavigationobject.cpp
Expand Up @@ -27,21 +27,20 @@ QgsTemporalNavigationObject::QgsTemporalNavigationObject( QObject *parent )
this, &QgsTemporalNavigationObject::timerTimeout );
}


void QgsTemporalNavigationObject::timerTimeout()
{
switch ( mPlayBackMode )
{
case PlaybackMode::Forward:
forward();
case AnimationState::Forward:
next();
break;

case PlaybackMode::Reverse:
backward();
case AnimationState::Reverse:
previous();
break;

case PlaybackMode::Idle:
pause();
case AnimationState::Idle:
// should not happen - in an idle state the timeout won't occur
break;
}
}
Expand Down Expand Up @@ -76,10 +75,6 @@ QgsDateTimeRange QgsTemporalNavigationObject::temporalExtents() const

void QgsTemporalNavigationObject::setCurrentFrameNumber( long long frameNumber )
{
if ( frameNumber < 0 ||
frameNumber >= totalFrameCount() )
return;

if ( mCurrentFrameNumber != frameNumber )
{
mCurrentFrameNumber = frameNumber;
Expand Down Expand Up @@ -133,14 +128,12 @@ void QgsTemporalNavigationObject::playForward()
{
setAnimationState( AnimationState::Forward );
play();
next();
}

void QgsTemporalNavigationObject::playBackward()
{
setAnimationState( AnimationState::Reverse );
play();
previous();
}

void QgsTemporalNavigationObject::next()
Expand Down

0 comments on commit 2e07961

Please sign in to comment.