Skip to content

Commit

Permalink
Do not add empty Fill for stroke-only SLD
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jan 13, 2023
1 parent 788c664 commit 8bd7832
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/symbology/qgsfillsymbollayer.cpp
Expand Up @@ -399,10 +399,6 @@ void QgsSimpleFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, c
symbolizerElem.setAttribute( QStringLiteral( "uom" ), props.value( QStringLiteral( "uom" ), QString() ).toString() );
element.appendChild( symbolizerElem );

// <Fill>
QDomElement fillElem = doc.createElement( QStringLiteral( "se:Fill" ) );
symbolizerElem.appendChild( fillElem );

// <Geometry>
QgsSymbolLayerUtils::createGeometryElement( doc, symbolizerElem, props.value( QStringLiteral( "geom" ), QString() ).toString() );

Expand All @@ -416,6 +412,9 @@ void QgsSimpleFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, c
const QImage image { toTiledPatternImage( ) };
if ( ! image.isNull() )
{
// <Fill>
QDomElement fillElem = doc.createElement( QStringLiteral( "se:Fill" ) );
symbolizerElem.appendChild( fillElem );
QDomElement graphicFillElem = doc.createElement( QStringLiteral( "se:GraphicFill" ) );
fillElem.appendChild( graphicFillElem );
QDomElement graphicElem = doc.createElement( QStringLiteral( "se:Graphic" ) );
Expand Down Expand Up @@ -444,6 +443,9 @@ void QgsSimpleFillSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, c
{
color.setAlphaF( color.alphaF() * alpha );
}
// <Fill>
QDomElement fillElem = doc.createElement( QStringLiteral( "se:Fill" ) );
symbolizerElem.appendChild( fillElem );
QgsSymbolLayerUtils::fillToSld( doc, fillElem, mBrushStyle, color );
}

Expand Down

0 comments on commit 8bd7832

Please sign in to comment.