Skip to content
Permalink
Browse files

fix cloning of symbol

  • Loading branch information
3nids committed Jan 6, 2021
1 parent 3201fa4 commit 29f5669da7dad8805eb738cd0f144c380b253f7b
Showing with 15 additions and 2 deletions.
  1. +14 −1 src/core/symbology/qgsmarkersymbollayer.cpp
  2. +1 −1 src/core/symbology/qgsmarkersymbollayer.h
@@ -1979,6 +1979,11 @@ bool QgsSvgMarkerSymbolLayer::setPreservedAspectRatio( bool par )
return preservedAspectRatio();
}

void QgsSvgMarkerSymbolLayer::setParameters( const QMap<QString, QgsProperty> &parameters )
{
mParameters = parameters;
}


QString QgsSvgMarkerSymbolLayer::layerType() const
{
@@ -2291,7 +2296,15 @@ QgsSvgMarkerSymbolLayer *QgsSvgMarkerSymbolLayer::clone() const
m->setSizeMapUnitScale( mSizeMapUnitScale );
m->setHorizontalAnchorPoint( mHorizontalAnchorPoint );
m->setVerticalAnchorPoint( mVerticalAnchorPoint );
m->setParameters( mParameters );

QMap<QString, QgsProperty> parameters;
QMap<QString, QgsProperty>::const_iterator paramIt = mParameters.constBegin();
for ( ; paramIt != mParameters.constEnd(); ++paramIt )
{
parameters.insert( paramIt.key(), QgsProperty::fromExpression( paramIt.value().expressionString() ) );
}
m->setParameters( parameters );

copyDataDefinedProperties( m );
copyPaintEffect( m );
return m;
@@ -599,7 +599,7 @@ class CORE_EXPORT QgsSvgMarkerSymbolLayer : public QgsMarkerSymbolLayer
* Sets the dynamic SVG parameters
* \since QGIS 3.18
*/
void setParameters( const QMap<QString, QgsProperty> &parameters ) { mParameters = parameters; }
void setParameters( const QMap<QString, QgsProperty> &parameters );

/**
* Sets the units for the stroke width.

0 comments on commit 29f5669

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