Skip to content

Commit

Permalink
Fix geometry generator used in subsymbol of point pattern fill results
Browse files Browse the repository at this point in the history
in only a single marker being rendered
  • Loading branch information
nyalldawson committed Oct 25, 2021
1 parent 3429203 commit 0785488
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Expand Up @@ -1802,6 +1802,10 @@ Caller takes ownership of the returned symbol layer.

virtual void stopRender( QgsSymbolRenderContext &context );

virtual void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context );

virtual void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context );

virtual void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context );

virtual QVariantMap properties() const;
Expand Down
14 changes: 14 additions & 0 deletions src/core/symbology/qgsfillsymbollayer.cpp
Expand Up @@ -3583,6 +3583,20 @@ void QgsPointPatternFillSymbolLayer::stopRender( QgsSymbolRenderContext &context
}
}

void QgsPointPatternFillSymbolLayer::startFeatureRender( const QgsFeature &, QgsRenderContext & )
{
// The base class version passes this on to the subsymbol, but we deliberately don't do that here.
// Otherwise generators used in the subsymbol will only render a single point per feature (they
// have logic to only render once per paired call to startFeatureRender/stopFeatureRender).
}

void QgsPointPatternFillSymbolLayer::stopFeatureRender( const QgsFeature &, QgsRenderContext & )
{
// The base class version passes this on to the subsymbol, but we deliberately don't do that here.
// Otherwise generators used in the subsymbol will only render a single point per feature (they
// have logic to only render once per paired call to startFeatureRender/stopFeatureRender).
}

void QgsPointPatternFillSymbolLayer::renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
{
if ( !mRenderUsingMarkers )
Expand Down
2 changes: 2 additions & 0 deletions src/core/symbology/qgsfillsymbollayer.h
Expand Up @@ -1657,6 +1657,8 @@ class CORE_EXPORT QgsPointPatternFillSymbolLayer: public QgsImageFillSymbolLayer
QString layerType() const override;
void startRender( QgsSymbolRenderContext &context ) override;
void stopRender( QgsSymbolRenderContext &context ) override;
void startFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
void stopFeatureRender( const QgsFeature &feature, QgsRenderContext &context ) override;
void renderPolygon( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context ) override;
QVariantMap properties() const override;
QgsPointPatternFillSymbolLayer *clone() const override SIP_FACTORY;
Expand Down

0 comments on commit 0785488

Please sign in to comment.