Skip to content

Commit

Permalink
Fix map units in centroid symbol layer (ticket 7738)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed May 7, 2013
1 parent 0bf17b5 commit c5142da
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1593,9 +1593,8 @@ void QgsPointPatternFillSymbolLayer::applyDataDefinedSettings( const QgsSymbolV2
//////////////


QgsCentroidFillSymbolLayerV2::QgsCentroidFillSymbolLayerV2()
QgsCentroidFillSymbolLayerV2::QgsCentroidFillSymbolLayerV2(): mMarker( NULL )
{
mMarker = NULL;
setSubSymbol( new QgsMarkerSymbolV2() );
}

Expand All @@ -1604,8 +1603,9 @@ QgsCentroidFillSymbolLayerV2::~QgsCentroidFillSymbolLayerV2()
delete mMarker;
}

QgsSymbolLayerV2* QgsCentroidFillSymbolLayerV2::create( const QgsStringMap& /*properties*/ )
QgsSymbolLayerV2* QgsCentroidFillSymbolLayerV2::create( const QgsStringMap& properties )
{
Q_UNUSED( properties );
return new QgsCentroidFillSymbolLayerV2();
}

Expand All @@ -1623,8 +1623,6 @@ void QgsCentroidFillSymbolLayerV2::setColor( const QColor& color )
void QgsCentroidFillSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
{
mMarker->setAlpha( context.alpha() );
mMarker->setOutputUnit( context.outputUnit() );

mMarker->startRender( context.renderContext() );
}

Expand Down Expand Up @@ -1712,3 +1710,12 @@ bool QgsCentroidFillSymbolLayerV2::setSubSymbol( QgsSymbolV2* symbol )
mColor = mMarker->color();
return true;
}

QgsSymbolV2::OutputUnit QgsCentroidFillSymbolLayerV2::outputUnit() const
{
if ( mMarker )
{
return mMarker->outputUnit();
}
return QgsSymbolV2::Mixed; //mOutputUnit;
}
3 changes: 3 additions & 0 deletions src/core/symbology-ng/qgsfillsymbollayerv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ class CORE_EXPORT QgsCentroidFillSymbolLayerV2 : public QgsFillSymbolLayerV2
QgsSymbolV2* subSymbol();
bool setSubSymbol( QgsSymbolV2* symbol );

void setOutputUnit( QgsSymbolV2::OutputUnit unit ) { Q_UNUSED( unit ); }
QgsSymbolV2::OutputUnit outputUnit() const;

protected:
QgsMarkerSymbolV2* mMarker;
};
Expand Down

0 comments on commit c5142da

Please sign in to comment.