[symbology] add diamond ellipse marker

This commit is contained in:
Webmaster 2016-04-13 19:17:33 +07:00
parent b7a4e20627
commit 7c779aea3c
3 changed files with 10 additions and 2 deletions

View File

@ -597,6 +597,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 );

View File

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

View File

@ -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 )