Skip to content
Permalink
Browse files

Minor fixes to temporal navigation object logic

  • Loading branch information
nyalldawson committed Mar 11, 2020
1 parent f58e465 commit 2e07961cda54fbca1deca038a6a79a0c4c6ec779
Showing with 6 additions and 13 deletions.
  1. +6 −13 src/core/qgstemporalnavigationobject.cpp
@@ -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;
}
}
@@ -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;
@@ -133,14 +128,12 @@ void QgsTemporalNavigationObject::playForward()
{
setAnimationState( AnimationState::Forward );
play();
next();
}

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

void QgsTemporalNavigationObject::next()

0 comments on commit 2e07961

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