|
@@ -780,6 +780,15 @@ QgsSymbolLayerV2* QgsSvgMarkerSymbolLayerV2::create( const QgsStringMap& props ) |
|
|
if ( props.contains( "outline_width_unit" ) ) |
|
|
m->setOutlineWidthUnit( QgsSymbolLayerV2Utils::decodeOutputUnit( props["outline_width_unit"] ) ); |
|
|
|
|
|
if ( props.contains( "horizontal_anchor_point" ) ) |
|
|
{ |
|
|
m->setHorizontalAnchorPoint( QgsMarkerSymbolLayerV2::HorizontalAnchorPoint( props[ "horizontal_anchor_point" ].toInt() ) ); |
|
|
} |
|
|
if ( props.contains( "vertical_anchor_point" ) ) |
|
|
{ |
|
|
m->setVerticalAnchorPoint( QgsMarkerSymbolLayerV2::VerticalAnchorPoint( props[ "vertical_anchor_point" ].toInt() ) ); |
|
|
} |
|
|
|
|
|
//data defined properties |
|
|
if ( props.contains( "size_expression" ) ) |
|
|
{ |
|
@@ -887,15 +896,10 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re |
|
|
|
|
|
p->save(); |
|
|
|
|
|
QPointF offset = mOffset; |
|
|
QgsExpression* offsetExpression = expression( "offset" ); |
|
|
if ( offsetExpression ) |
|
|
{ |
|
|
QString offsetString = offsetExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toString(); |
|
|
offset = QgsSymbolLayerV2Utils::decodePoint( offsetString ); |
|
|
} |
|
|
double offsetX = offset.x() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit ); |
|
|
double offsetY = offset.y() * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOffsetUnit ); |
|
|
//offset |
|
|
double offsetX = 0; |
|
|
double offsetY = 0; |
|
|
markerOffset( context, offsetX, offsetY ); |
|
|
QPointF outputOffset( offsetX, offsetY ); |
|
|
|
|
|
double angle = mAngle; |
|
@@ -1016,6 +1020,9 @@ QgsStringMap QgsSvgMarkerSymbolLayerV2::properties() const |
|
|
map["outline"] = mOutlineColor.name(); |
|
|
map["outline-width"] = QString::number( mOutlineWidth ); |
|
|
map["outline_width_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOutlineWidthUnit ); |
|
|
map["horizontal_anchor_point"] = QString::number( mHorizontalAnchorPoint ); |
|
|
map["vertical_anchor_point"] = QString::number( mVerticalAnchorPoint ); |
|
|
|
|
|
saveDataDefinedProperties( map ); |
|
|
return map; |
|
|
} |
|
@@ -1030,6 +1037,8 @@ QgsSymbolLayerV2* QgsSvgMarkerSymbolLayerV2::clone() const |
|
|
m->setOffset( mOffset ); |
|
|
m->setOffsetUnit( mOffsetUnit ); |
|
|
m->setSizeUnit( mSizeUnit ); |
|
|
m->setHorizontalAnchorPoint( mHorizontalAnchorPoint ); |
|
|
m->setVerticalAnchorPoint( mVerticalAnchorPoint ); |
|
|
copyDataDefinedProperties( m ); |
|
|
return m; |
|
|
} |
|
|