Skip to content
Permalink
Browse files

Merge pull request #3000 from nirvn/diamond_ellipse_marker

[symbology] add diamond ellipse marker
  • Loading branch information
nyalldawson committed Apr 14, 2016
2 parents a7f08fd + 69235e6 commit d8a314c44b78f10192d0472b204c718d10f4fcb2
@@ -367,6 +367,8 @@ QgsEllipseSymbolLayerV2* QgsEllipseSymbolLayerV2::clone() const
m->setSymbolWidth( mSymbolWidth );
m->setSymbolHeight( mSymbolHeight );
m->setOutlineStyle( mOutlineStyle );
m->setOffset( mOffset );
m->setOffsetUnit( mOffsetUnit );
m->setOffsetMapUnitScale( mOffsetMapUnitScale );
m->setOutlineStyle( mOutlineStyle );
m->setPenJoinStyle( mPenJoinStyle );
@@ -597,6 +599,14 @@ void QgsEllipseSymbolLayerV2::preparePath( const QString& symbolName, QgsSymbolV
{
mPainterPath.addRect( QRectF( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height() ) );
}
else if ( symbolName == "diamond" )
{
mPainterPath.moveTo( -size.width() / 2.0, 0 );
mPainterPath.lineTo( 0, size.height() / 2.0 );
mPainterPath.lineTo( size.width() / 2.0, 0 );
mPainterPath.lineTo( 0, -size.height() / 2.0 );
mPainterPath.lineTo( -size.width() / 2.0, 0 );
}
else if ( symbolName == "cross" )
{
mPainterPath.moveTo( 0, -size.height() / 2.0 );
@@ -896,7 +896,7 @@ QString QgsDataDefinedButton::fillStyleDesc()

QString QgsDataDefinedButton::markerStyleDesc()
{
return trString() + QLatin1String( "[<b>circle</b>|<b>rectangle</b>|<b>cross</b>|<b>triangle"
return trString() + QLatin1String( "[<b>circle</b>|<b>rectangle</b>|<b>diamond</b>|<b>cross</b>|<b>triangle"
"</b>|<b>right_half_triangle</b>|<b>left_half_triangle</b>|<b>semi_circle</b>]" );
}

@@ -46,7 +46,7 @@ QgsEllipseSymbolLayerV2Widget::QgsEllipseSymbolLayerV2Widget( const QgsVectorLay
mRotationSpinBox->setClearValue( 0.0 );

QStringList names;
names << "circle" << "rectangle" << "cross" << "triangle" << "right_half_triangle" << "left_half_triangle" << "semi_circle";
names << "circle" << "rectangle" << "diamond" << "cross" << "triangle" << "right_half_triangle" << "left_half_triangle" << "semi_circle";
QSize iconSize = mShapeListWidget->iconSize();

Q_FOREACH ( const QString& name, names )

0 comments on commit d8a314c

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