Skip to content
Permalink
Browse files

When using the temporal controller in filter mode, the time filter

should be begin <= t < end, not begin <= t <= end

We want the same range in animation mode to match the results
we see in time filter mode, and the UI (now) shows clearly that
the upper range isn't included in the filter
  • Loading branch information
nyalldawson committed Mar 30, 2021
1 parent a38be2c commit 75975bb48e1dc13eeb4f9eaa2bca80beb7ad09e7
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/gui/qgstemporalcontrollerwidget.cpp
@@ -281,8 +281,13 @@ void QgsTemporalControllerWidget::togglePause()

void QgsTemporalControllerWidget::updateTemporalExtent()
{
QgsDateTimeRange temporalExtent = QgsDateTimeRange( mStartDateTime->dateTime(),
mEndDateTime->dateTime() );
// TODO - consider whether the overall time range set for animations should include the end date time or not.
// (currently it DOES include the end date time).
const QDateTime start = mStartDateTime->dateTime();
const QDateTime end = mEndDateTime->dateTime();
const bool isTimeInstant = start == end;
QgsDateTimeRange temporalExtent = QgsDateTimeRange( start, end,
true, !isTimeInstant && mNavigationObject->navigationMode() == QgsTemporalNavigationObject::FixedRange ? false : true );
mNavigationObject->setTemporalExtents( temporalExtent );
mSlider->setRange( 0, mNavigationObject->totalFrameCount() - 1 );
mSlider->setValue( mNavigationObject->currentFrameNumber() );

0 comments on commit 75975bb

Please sign in to comment.