Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Mar 17, 2021
1 parent 01f1f0c commit 2cbb130
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Expand Up @@ -52,7 +52,7 @@ leaves the actual drawing of the symbols to subclasses.
Octagon,
SquareWithCorners,
AsteriskFill,
SemiArc,
HalfArc,
ThirdArc,
QuarterArc,
};
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology/qgsellipsesymbollayer.cpp
Expand Up @@ -641,7 +641,7 @@ void QgsEllipseSymbolLayer::preparePath( const QString &symbolName, QgsSymbolRen
mPainterPath.lineTo( 0, -size.height() / 2.0 );
mPainterPath.lineTo( size.width() / 2.0, size.height() / 2.0 );
}
else if ( symbolName == QLatin1String( "semi_arc" ) )
else if ( symbolName == QLatin1String( "half_arc" ) )
{
mPainterPath.moveTo( size.width() / 2.0, 0 );
mPainterPath.arcTo( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height(), 0, 180 );
Expand Down Expand Up @@ -671,7 +671,7 @@ void QgsEllipseSymbolLayer::preparePath( const QString &symbolName, QgsSymbolRen

bool QgsEllipseSymbolLayer::shapeIsFilled( const QString &symbolName ) const
{
return symbolName == QLatin1String( "cross" ) || symbolName == QLatin1String( "arrow" ) || symbolName == QLatin1String( "semi_arc" ) ? false : true;
return symbolName == QLatin1String( "cross" ) || symbolName == QLatin1String( "arrow" ) || symbolName == QLatin1String( "half_arc" ) ? false : true;
}

void QgsEllipseSymbolLayer::setSize( double size )
Expand Down
16 changes: 8 additions & 8 deletions src/core/symbology/qgsmarkersymbollayer.cpp
Expand Up @@ -75,7 +75,7 @@ QList<QgsSimpleMarkerSymbolLayerBase::Shape> QgsSimpleMarkerSymbolLayerBase::ava
<< CrossFill
<< Cross2
<< Line
<< SemiArc
<< HalfArc
<< ThirdArc
<< QuarterArc
<< ArrowHead
Expand Down Expand Up @@ -136,7 +136,7 @@ bool QgsSimpleMarkerSymbolLayerBase::shapeIsFilled( QgsSimpleMarkerSymbolLayerBa
case Cross2:
case Line:
case ArrowHead:
case SemiArc:
case HalfArc:
case ThirdArc:
case QuarterArc:
return false;
Expand Down Expand Up @@ -362,8 +362,8 @@ QgsSimpleMarkerSymbolLayerBase::Shape QgsSimpleMarkerSymbolLayerBase::decodeShap
return LeftHalfTriangle;
else if ( cleaned == QLatin1String( "asterisk_fill" ) )
return AsteriskFill;
else if ( cleaned == QLatin1String( "semi_arc" ) )
return SemiArc;
else if ( cleaned == QLatin1String( "half_arc" ) )
return HalfArc;
else if ( cleaned == QLatin1String( "third_arc" ) )
return ThirdArc;
else if ( cleaned == QLatin1String( "quarter_arc" ) )
Expand Down Expand Up @@ -430,8 +430,8 @@ QString QgsSimpleMarkerSymbolLayerBase::encodeShape( QgsSimpleMarkerSymbolLayerB
return QStringLiteral( "quarter_circle" );
case AsteriskFill:
return QStringLiteral( "asterisk_fill" );
case SemiArc:
return QStringLiteral( "semi_arc" );
case HalfArc:
return QStringLiteral( "half_arc" );
case ThirdArc:
return QStringLiteral( "third_arc" );
case QuarterArc:
Expand Down Expand Up @@ -653,7 +653,7 @@ bool QgsSimpleMarkerSymbolLayerBase::shapeToPolygon( QgsSimpleMarkerSymbolLayerB
case SemiCircle:
case ThirdCircle:
case QuarterCircle:
case SemiArc:
case HalfArc:
case ThirdArc:
case QuarterArc:
return false;
Expand Down Expand Up @@ -688,7 +688,7 @@ bool QgsSimpleMarkerSymbolLayerBase::prepareMarkerPath( QgsSimpleMarkerSymbolLay
mPath.lineTo( 0, 0 );
return true;

case SemiArc:
case HalfArc:
mPath.moveTo( 1, 0 );
mPath.arcTo( -1, -1, 2, 2, 0, 180 );
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology/qgsmarkersymbollayer.h
Expand Up @@ -74,9 +74,9 @@ class CORE_EXPORT QgsSimpleMarkerSymbolLayerBase : public QgsMarkerSymbolLayer
Octagon, //!< Octagon (since QGIS 3.18)
SquareWithCorners, //!< A square with diagonal corners (since QGIS 3.18)
AsteriskFill, //!< A filled asterisk shape (since QGIS 3.18)
SemiArc, //!< A line-only semi arc (since QGIS 3.20)
HalfArc, //!< A line-only half arc (since QGIS 3.20)
ThirdArc, //!< A line-only one third arc (since QGIS 3.20)
QuarterArc, //!< A line-only quarter arc (since QGIS 3.20)
QuarterArc, //!< A line-only one quarter arc (since QGIS 3.20)
};

//! Returns a list of all available shape types.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology/qgsellipsesymbollayerwidget.cpp
Expand Up @@ -66,7 +66,7 @@ QgsEllipseSymbolLayerWidget::QgsEllipseSymbolLayerWidget( QgsVectorLayer *vl, QW
mRotationSpinBox->setClearValue( 0.0 );

QStringList names;
names << QStringLiteral( "circle" ) << QStringLiteral( "rectangle" ) << QStringLiteral( "diamond" ) << QStringLiteral( "cross" ) << QStringLiteral( "arrow" ) << QStringLiteral( "semi_arc" ) << QStringLiteral( "triangle" ) << QStringLiteral( "right_half_triangle" ) << QStringLiteral( "left_half_triangle" ) << QStringLiteral( "semi_circle" );
names << QStringLiteral( "circle" ) << QStringLiteral( "rectangle" ) << QStringLiteral( "diamond" ) << QStringLiteral( "cross" ) << QStringLiteral( "arrow" ) << QStringLiteral( "half_arc" ) << QStringLiteral( "triangle" ) << QStringLiteral( "right_half_triangle" ) << QStringLiteral( "left_half_triangle" ) << QStringLiteral( "semi_circle" );

int size = mShapeListWidget->iconSize().width();
size = std::max( 30, static_cast< int >( std::round( Qgis::UI_SCALE_FACTOR * fontMetrics().horizontalAdvance( 'X' ) * 3 ) ) );
Expand Down

0 comments on commit 2cbb130

Please sign in to comment.