Skip to content

Commit

Permalink
Completely skip rendering layers which are outside of the map's z range
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 28, 2020
1 parent 2632627 commit 51ae398
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/qgsmaprendererjob.cpp
Expand Up @@ -44,6 +44,7 @@
#include "qgsvectorlayerutils.h"
#include "qgssymbollayerutils.h"
#include "qgsmaplayertemporalproperties.h"
#include "qgsmaplayerelevationproperties.h"
#include "qgsannotationlayer.h"

///@cond PRIVATE
Expand Down Expand Up @@ -340,6 +341,12 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
continue;
}

if ( !mSettings.zRange().isInfinite() && ml->elevationProperties() && !ml->elevationProperties()->isVisibleInZRange( mSettings.zRange() ) )
{
QgsDebugMsgLevel( QStringLiteral( "Layer not rendered because it is not visible within the map's z range" ), 3 );
continue;
}

QgsRectangle r1 = mSettings.visibleExtent(), r2;
r1.grow( mSettings.extentBuffer() );
QgsCoordinateTransform ct;
Expand Down

0 comments on commit 51ae398

Please sign in to comment.