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 90df2b3 commit e3289f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgstemporalutils.cpp
Expand Up @@ -116,7 +116,6 @@ bool QgsTemporalUtils::exportAnimation( const QgsMapSettings &mapSettings, const
}
feedback->setProgress( currentFrame / static_cast<double>( totalFrames ) * 100 );
}
++currentFrame;

navigator.setCurrentFrameNumber( currentFrame );

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

img.save( path );

++currentFrame;
}

return true;
Expand Down

0 comments on commit e3289f3

Please sign in to comment.