Skip to content
Permalink
Browse files
Inverted renderer: make sure it works when no painter is here (featur…
…e count)
  • Loading branch information
Hugo Mercier committed May 26, 2014
1 parent 7906154 commit 19041a800914b89f2f6bfe86e1237f168776960f
Showing with 13 additions and 1 deletion.
  1. +13 −1 src/core/symbology-ng/qgsinvertedpolygonrenderer.cpp
@@ -73,6 +73,11 @@ void QgsInvertedPolygonRenderer::startRender( QgsRenderContext& context, const Q
// It must be computed in the destination CRS if reprojection is enabled.
const QgsMapToPixel& mtp( context.mapToPixel() );

if ( !context.painter() )
{
return;
}

// convert viewport to dest CRS
QRect e( context.painter()->viewport() );
// add some space to hide borders and tend to infinity
@@ -102,7 +107,10 @@ void QgsInvertedPolygonRenderer::startRender( QgsRenderContext& context, const Q

bool QgsInvertedPolygonRenderer::renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer, bool selected, bool drawVertexMarker )
{
Q_UNUSED( context );
if ( !context.painter() )
{
return false;
}

// store this feature as a feature to render with decoration if needed
if ( selected || drawVertexMarker )
@@ -223,6 +231,10 @@ void QgsInvertedPolygonRenderer::stopRender( QgsRenderContext& context )
if ( !mSubRenderer ) {
return;
}
if ( !context.painter() )
{
return;
}

for ( FeatureCategoryMap::iterator cit = mFeaturesCategoryMap.begin(); cit != mFeaturesCategoryMap.end(); ++cit)
{

0 comments on commit 19041a8

Please sign in to comment.