Skip to content
Permalink
Browse files

Fix map units in centroid symbol layer (ticket 7738)

  • Loading branch information
mhugent committed May 7, 2013
1 parent 0bf17b5 commit c5142dab2048f3b06207f79e5e5aed012a818697
Showing with 15 additions and 5 deletions.
  1. +12 −5 src/core/symbology-ng/qgsfillsymbollayerv2.cpp
  2. +3 −0 src/core/symbology-ng/qgsfillsymbollayerv2.h
@@ -1593,9 +1593,8 @@ void QgsPointPatternFillSymbolLayer::applyDataDefinedSettings( const QgsSymbolV2
//////////////


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

@@ -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();
}

@@ -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() );
}

@@ -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;
}
@@ -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;
};

0 comments on commit c5142da

Please sign in to comment.
You can’t perform that action at this time.