Skip to content

Commit b46a172

Browse files
committedSep 28, 2016
categorized renderer: also setup symbol render context for hashed symbols
(cherry picked from commit c7c5244)
1 parent d843aff commit b46a172

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed
 

‎src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ QgsCategorizedSymbolRendererV2::QgsCategorizedSymbolRendererV2( const QString& a
159159
//trigger a detachment and copy of mCategories BUT that same method CAN be used to modify a symbol in place
160160
Q_FOREACH ( const QgsRendererCategoryV2& cat, categories )
161161
{
162-
if ( cat.symbol() )
162+
if ( !cat.symbol() )
163163
{
164-
QgsDebugMsg( "invalid symbol in a category! ignoring..." );
164+
QgsDebugMsg( QString( "invalid symbol in category %1 (%2)! ignoring..." ).arg( cat.value().toString(), cat.label() ) );
165165
}
166166
mCategories << cat;
167167
}
@@ -442,6 +442,12 @@ void QgsCategorizedSymbolRendererV2::startRender( QgsRenderContext& context, con
442442
mTempSymbols[ cat.symbol()] = tempSymbol;
443443
}
444444
}
445+
446+
Q_FOREACH ( QgsSymbolV2 *symbol, mSymbolHash.values() )
447+
{
448+
symbol->startRender( context, &fields );
449+
}
450+
445451
return;
446452
}
447453

@@ -452,6 +458,11 @@ void QgsCategorizedSymbolRendererV2::stopRender( QgsRenderContext& context )
452458
cat.symbol()->stopRender( context );
453459
}
454460

461+
Q_FOREACH ( QgsSymbolV2 *symbol, mSymbolHash.values() )
462+
{
463+
symbol->stopRender( context );
464+
}
465+
455466
// cleanup mTempSymbols
456467
QHash<QgsSymbolV2*, QgsSymbolV2*>::const_iterator it2 = mTempSymbols.constBegin();
457468
for ( ; it2 != mTempSymbols.constEnd(); ++it2 )

0 commit comments

Comments
 (0)
Please sign in to comment.