Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #48942 add 1 timestep to AnimationRange #49283

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/mesh/qgsmeshdataprovidertemporalcapabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ QgsDateTimeRange QgsMeshDataProviderTemporalCapabilities::timeExtent( const QDat
if ( !times.isEmpty() )
{
durationSinceFirst += times.first();
durationSinceLast += times.last();
// adding one timestep (length as: times.last() - times.beforeLast)), to be sure we have enough steps
durationSinceLast += times.last() + ( times.last() - times[times.length() - 2] );
Copy link
Contributor Author

@rduivenvoorde rduivenvoorde Jul 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that having data with just 1 timestep, the 'times' here will be empty, so you will only enter this if when length is at least 2 so times[times.length() - 2] is safe.

}

if ( !end.isValid() || groupReference.addMSecs( durationSinceLast ) > end )
Expand Down