Skip to content
Permalink
Browse files
Mask renderer: reuse existing renderer as embedded
  • Loading branch information
Hugo Mercier committed May 23, 2014
1 parent 3ec7337 commit 84b1577420410c9932d6ff5f6058b0f75b7d76c8
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/gui/symbology-ng/qgsmaskrendererv2widget.cpp
@@ -52,13 +52,21 @@ QgsMaskRendererV2Widget::QgsMaskRendererV2Widget( QgsVectorLayer* layer, QgsStyl

// try to recognize the previous renderer
// (null renderer means "no previous renderer")
if ( !renderer || renderer->type() != "maskRenderer" )
if ( !renderer )
{
// a new renderer
mRenderer.reset( new QgsMaskRendererV2() );
}
else if ( renderer && renderer->type() != "maskRenderer" )
{
// an existing renderer, but not a mask renderer
// create a mask renderer, with the existing renderer embedded
mRenderer.reset( new QgsMaskRendererV2( renderer ) );
}
else
{
mRenderer.reset( static_cast<QgsMaskRendererV2*>( renderer ) );
// an existing mask renderer
mRenderer.reset( static_cast<QgsMaskRendererV2*>(renderer) );
}

int currentEmbeddedIdx = 0;

0 comments on commit 84b1577

Please sign in to comment.