Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[vector tiles] Fix handling of text buffer default color and opacity
  • Loading branch information
nirvn authored and nyalldawson committed Apr 10, 2023
1 parent 7508c01 commit e8f2feb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/vectortile/qgsmapboxglstyleconverter.cpp
Expand Up @@ -1375,7 +1375,7 @@ void QgsMapBoxGlStyleConverter::parseSymbolLayer( const QVariantMap &jsonLayer,
}

// buffer color
QColor bufferColor;
QColor bufferColor( 0, 0, 0, 0 );
if ( jsonPaint.contains( QStringLiteral( "text-halo-color" ) ) )
{
const QVariant jsonBufferColor = jsonPaint.value( QStringLiteral( "text-halo-color" ) );
Expand Down Expand Up @@ -1474,10 +1474,15 @@ void QgsMapBoxGlStyleConverter::parseSymbolLayer( const QVariantMap &jsonLayer,

if ( bufferSize > 0 )
{
// Color and opacity are separate components in QGIS
const double opacity = bufferColor.alphaF();
bufferColor.setAlphaF( 1.0 );

format.buffer().setEnabled( true );
format.buffer().setSize( bufferSize );
format.buffer().setSizeUnit( context.targetUnit() );
format.buffer().setColor( bufferColor );
format.buffer().setOpacity( opacity );

if ( haloBlurSize > 0 )
{
Expand Down

0 comments on commit e8f2feb

Please sign in to comment.