Skip to content

Commit

Permalink
Move currentFrame increment to the end of the loop
Browse files Browse the repository at this point in the history
This fixes a bug that causes the first frame in a temporal
animation to be skipped since currentFrame is initialized to be
zero, but then before the first frame is rendered frame number is
incremented. This is a fix for #42932.
  • Loading branch information
pwicks86 authored and nyalldawson committed Apr 26, 2021
1 parent 3e4acec commit ce2476c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgstemporalutils.cpp
Expand Up @@ -98,7 +98,6 @@ bool QgsTemporalUtils::exportAnimation( const QgsMapSettings &mapSettings, const
}
feedback->setProgress( currentFrame / static_cast<double>( totalFrames ) * 100 );
}
++currentFrame;

navigator.setCurrentFrameNumber( currentFrame );

Expand Down Expand Up @@ -137,6 +136,8 @@ bool QgsTemporalUtils::exportAnimation( const QgsMapSettings &mapSettings, const
p.end();

img.save( path );

++currentFrame;
}

return true;
Expand Down

0 comments on commit ce2476c

Please sign in to comment.