Skip to content
Permalink
Browse files
Move currentFrame increment to the end of the loop
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 github-actions committed Apr 26, 2021
1 parent 8f0e606 commit 8d1234028cd573cdde96d685647ad34f4738e164
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/core/qgstemporalutils.cpp
@@ -98,7 +98,6 @@ bool QgsTemporalUtils::exportAnimation( const QgsMapSettings &mapSettings, const
}
feedback->setProgress( currentFrame / static_cast<double>( totalFrames ) * 100 );
}
++currentFrame;

navigator.setCurrentFrameNumber( currentFrame );

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

img.save( path );

++currentFrame;
}

return true;

0 comments on commit 8d12340

Please sign in to comment.