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 authored and github-actions[bot] committed Apr 9, 2023
1 parent dea5892 commit e9a5277
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/core/vectortile/qgsvectortilebasicrenderer.cpp
Expand Up @@ -170,20 +170,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 e9a5277

Please sign in to comment.