@@ -169,20 +169,23 @@ void QgsVectorTileBasicRenderer::renderBackground( QgsRenderContext &context )
169
169
if ( !layerStyle.symbol () || layerStyle.layerName () != QLatin1String ( " background" ) )
170
170
continue ;
171
171
172
- QgsSymbol *sym = layerStyle.symbol ();
173
- sym->startRender ( context, QgsFields () );
174
-
175
- QgsFillSymbol *fillSym = dynamic_cast <QgsFillSymbol *>( sym );
176
- if ( fillSym )
172
+ if ( layerStyle.isEnabled () )
177
173
{
178
- QPolygon polygon;
179
- polygon << QPoint ( 0 , 0 );
180
- polygon << QPoint ( 0 , context.outputSize ().height () );
181
- polygon << QPoint ( context.outputSize ().width (), context.outputSize ().height () );
182
- polygon << QPoint ( context.outputSize ().width (), 0 );
183
- fillSym->renderPolygon ( polygon, nullptr , nullptr , context );
174
+ QgsSymbol *sym = layerStyle.symbol ();
175
+ sym->startRender ( context, QgsFields () );
176
+
177
+ QgsFillSymbol *fillSym = dynamic_cast <QgsFillSymbol *>( sym );
178
+ if ( fillSym )
179
+ {
180
+ QPolygon polygon;
181
+ polygon << QPoint ( 0 , 0 );
182
+ polygon << QPoint ( 0 , context.outputSize ().height () );
183
+ polygon << QPoint ( context.outputSize ().width (), context.outputSize ().height () );
184
+ polygon << QPoint ( context.outputSize ().width (), 0 );
185
+ fillSym->renderPolygon ( polygon, nullptr , nullptr , context );
186
+ }
187
+ sym->stopRender ( context );
184
188
}
185
- sym->stopRender ( context );
186
189
break ;
187
190
}
188
191
}
0 commit comments