Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #9779 from qgis/backport-9763-to-release-3_6
Browse files Browse the repository at this point in the history
[Backport release-3_6] Apply SLD PointSymbolizer on single centroid for polygon
  • Loading branch information
rldhont committed Apr 12, 2019
2 parents e1756f5 + 5b40aeb commit 2a46246
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/core/symbology/qgsfillsymbollayer.cpp
Expand Up @@ -3512,6 +3512,7 @@ QgsSymbolLayer *QgsCentroidFillSymbolLayer::createFromSld( QDomElement &element

std::unique_ptr< QgsCentroidFillSymbolLayer > sl = qgis::make_unique< QgsCentroidFillSymbolLayer >();
sl->setSubSymbol( marker.release() );
sl->setPointOnAllParts( false );
return sl.release();
}

Expand Down
5 changes: 5 additions & 0 deletions tests/src/python/test_qgssymbollayer.py
Expand Up @@ -698,6 +698,11 @@ def testQgsCentroidFillSymbolLayer(self):
mMessage = 'Expected "%s" got "%s"' % (mExpectedValue, mValue)
assert mExpectedValue == mValue, mMessage

mExpectedValue = False
mValue = mSymbolLayer.pointOnAllParts()
mMessage = 'Expected "%s" got "%s"' % (mExpectedValue, mValue)
assert mExpectedValue == mValue, mMessage

# test colors, need to make sure colors are passed/retrieved from subsymbol
mSymbolLayer.setColor(QColor(150, 50, 100))
self.assertEqual(mSymbolLayer.color(), QColor(150, 50, 100))
Expand Down

0 comments on commit 2a46246

Please sign in to comment.