Skip to content

Commit

Permalink
Fixed point pattern fill usedAttributes(), fixes #7736
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Jan 26, 2014
1 parent 742f49f commit 3c5c7de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Expand Up @@ -2294,10 +2294,14 @@ void QgsPointPatternFillSymbolLayer::applyDataDefinedSettings( const QgsSymbolV2
QgsExpression* distanceYExpression = expression( "distance_y" );
QgsExpression* displacementXExpression = expression( "displacement_x" );
QgsExpression* displacementYExpression = expression( "displacement_y" );

#if 0
// TODO: enable but check also if mMarkerSymbol has data defined properties
if ( !distanceXExpression && !distanceYExpression && !displacementXExpression && !displacementYExpression )
{
return;
}
#endif

double distanceX = mDistanceX;
if ( distanceXExpression )
Expand All @@ -2322,12 +2326,21 @@ void QgsPointPatternFillSymbolLayer::applyDataDefinedSettings( const QgsSymbolV2
applyPattern( context, mBrush, distanceX, distanceY, displacementX, displacementY );
}


double QgsPointPatternFillSymbolLayer::estimateMaxBleed() const
{
return 0;
}

QSet<QString> QgsPointPatternFillSymbolLayer::usedAttributes() const
{
QSet<QString> attributes = QgsSymbolLayerV2::usedAttributes();

if ( mMarkerSymbol )
attributes.unite( mMarkerSymbol->usedAttributes() );

return attributes;
}

//////////////


Expand Down
2 changes: 2 additions & 0 deletions src/core/symbology-ng/qgsfillsymbollayerv2.h
Expand Up @@ -516,6 +516,8 @@ class CORE_EXPORT QgsPointPatternFillSymbolLayer: public QgsImageFillSymbolLayer
void setOutputUnit( QgsSymbolV2::OutputUnit unit );
QgsSymbolV2::OutputUnit outputUnit() const;

virtual QSet<QString> usedAttributes() const;

protected:
QgsMarkerSymbolV2* mMarkerSymbol;
double mDistanceX;
Expand Down

1 comment on commit 3c5c7de

@pcav
Copy link
Member

@pcav pcav commented on 3c5c7de Mar 7, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work done for Regione Toscana - SITA (CIG ZB10C90E5A)

Please sign in to comment.