Skip to content

Commit

Permalink
Don't append duplicate extents to extent history
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro authored and nyalldawson committed Nov 1, 2021
1 parent dabc17b commit d951961
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/qgsmapcanvas.cpp
Expand Up @@ -1264,7 +1264,10 @@ void QgsMapCanvas::setExtent( const QgsRectangle &r, bool magnified )
mLastExtent.removeAt( i );
}

mLastExtent.append( extent() );
if ( !mLastExtent.isEmpty() && mLastExtent.last() != extent() )
{
mLastExtent.append( extent() );
}

// adjust history to no more than 100
if ( mLastExtent.size() > 100 )
Expand Down

0 comments on commit d951961

Please sign in to comment.