Skip to content

Commit c27a241

Browse files
nirvnnyalldawson
authored andcommittedApr 9, 2023
[vector tiles] Follow up PR #52220: respect background style's enabled state
1 parent 31729cc commit c27a241

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed
 

‎src/core/vectortile/qgsvectortilebasicrenderer.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,23 @@ void QgsVectorTileBasicRenderer::renderBackground( QgsRenderContext &context )
169169
if ( !layerStyle.symbol() || layerStyle.layerName() != QLatin1String( "background" ) )
170170
continue;
171171

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() )
177173
{
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 );
184188
}
185-
sym->stopRender( context );
186189
break;
187190
}
188191
}

0 commit comments

Comments
 (0)
Please sign in to comment.