Skip to content

Commit

Permalink
categorized renderer: also setup symbol render context for hashed sym…
Browse files Browse the repository at this point in the history
…bols
  • Loading branch information
jef-n committed Sep 28, 2016
1 parent f49f7ce commit c7c5244
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp
Expand Up @@ -162,9 +162,9 @@ QgsCategorizedSymbolRendererV2::QgsCategorizedSymbolRendererV2( const QString& a
//trigger a detachment and copy of mCategories BUT that same method CAN be used to modify a symbol in place
Q_FOREACH ( const QgsRendererCategoryV2& cat, categories )
{
if ( cat.symbol() )
if ( !cat.symbol() )
{
QgsDebugMsg( "invalid symbol in a category! ignoring..." );
QgsDebugMsg( QString( "invalid symbol in category %1 (%2)! ignoring..." ).arg( cat.value().toString(), cat.label() ) );
}
mCategories << cat;
}
Expand Down Expand Up @@ -445,6 +445,12 @@ void QgsCategorizedSymbolRendererV2::startRender( QgsRenderContext& context, con
mTempSymbols[ cat.symbol()] = tempSymbol;
}
}

Q_FOREACH ( QgsSymbolV2 *symbol, mSymbolHash.values() )
{
symbol->startRender( context, &fields );
}

return;
}

Expand All @@ -455,6 +461,11 @@ void QgsCategorizedSymbolRendererV2::stopRender( QgsRenderContext& context )
cat.symbol()->stopRender( context );
}

Q_FOREACH ( QgsSymbolV2 *symbol, mSymbolHash.values() )
{
symbol->stopRender( context );
}

// cleanup mTempSymbols
QHash<QgsSymbolV2*, QgsSymbolV2*>::const_iterator it2 = mTempSymbols.constBegin();
for ( ; it2 != mTempSymbols.constEnd(); ++it2 )
Expand Down

0 comments on commit c7c5244

Please sign in to comment.