Skip to content

Commit 2e07961

Browse files
committedMar 12, 2020
Minor fixes to temporal navigation object logic
1 parent f58e465 commit 2e07961

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed
 

‎src/core/qgstemporalnavigationobject.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,20 @@ QgsTemporalNavigationObject::QgsTemporalNavigationObject( QObject *parent )
2727
this, &QgsTemporalNavigationObject::timerTimeout );
2828
}
2929

30-
3130
void QgsTemporalNavigationObject::timerTimeout()
3231
{
3332
switch ( mPlayBackMode )
3433
{
35-
case PlaybackMode::Forward:
36-
forward();
34+
case AnimationState::Forward:
35+
next();
3736
break;
3837

39-
case PlaybackMode::Reverse:
40-
backward();
38+
case AnimationState::Reverse:
39+
previous();
4140
break;
4241

43-
case PlaybackMode::Idle:
44-
pause();
42+
case AnimationState::Idle:
43+
// should not happen - in an idle state the timeout won't occur
4544
break;
4645
}
4746
}
@@ -76,10 +75,6 @@ QgsDateTimeRange QgsTemporalNavigationObject::temporalExtents() const
7675

7776
void QgsTemporalNavigationObject::setCurrentFrameNumber( long long frameNumber )
7877
{
79-
if ( frameNumber < 0 ||
80-
frameNumber >= totalFrameCount() )
81-
return;
82-
8378
if ( mCurrentFrameNumber != frameNumber )
8479
{
8580
mCurrentFrameNumber = frameNumber;
@@ -133,14 +128,12 @@ void QgsTemporalNavigationObject::playForward()
133128
{
134129
setAnimationState( AnimationState::Forward );
135130
play();
136-
next();
137131
}
138132

139133
void QgsTemporalNavigationObject::playBackward()
140134
{
141135
setAnimationState( AnimationState::Reverse );
142136
play();
143-
previous();
144137
}
145138

146139
void QgsTemporalNavigationObject::next()

0 commit comments

Comments
 (0)
Please sign in to comment.