Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[vector tiles] Follow up PR #52220: respect background style's enable…
…d state
  • Loading branch information
nirvn committed Apr 10, 2023
1 parent bac0de2 commit 795f850
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/core/vectortile/qgsvectortilebasicrenderer.cpp
Expand Up @@ -169,20 +169,23 @@ void QgsVectorTileBasicRenderer::renderBackground( QgsRenderContext &context )
if ( !layerStyle.symbol() || layerStyle.layerName() != QLatin1String( "background" ) )
continue;

QgsSymbol *sym = layerStyle.symbol();
sym->startRender( context, QgsFields() );

QgsFillSymbol *fillSym = dynamic_cast<QgsFillSymbol *>( sym );
if ( fillSym )
if ( layerStyle.isEnabled() )
{
QPolygon polygon;
polygon << QPoint( 0, 0 );
polygon << QPoint( 0, context.outputSize().height() );
polygon << QPoint( context.outputSize().width(), context.outputSize().height() );
polygon << QPoint( context.outputSize().width(), 0 );
fillSym->renderPolygon( polygon, nullptr, nullptr, context );
QgsSymbol *sym = layerStyle.symbol();
sym->startRender( context, QgsFields() );

QgsFillSymbol *fillSym = dynamic_cast<QgsFillSymbol *>( sym );
if ( fillSym )
{
QPolygon polygon;
polygon << QPoint( 0, 0 );
polygon << QPoint( 0, context.outputSize().height() );
polygon << QPoint( context.outputSize().width(), context.outputSize().height() );
polygon << QPoint( context.outputSize().width(), 0 );
fillSym->renderPolygon( polygon, nullptr, nullptr, context );
}
sym->stopRender( context );
}
sym->stopRender( context );
break;
}
}
Expand Down

0 comments on commit 795f850

Please sign in to comment.