@@ -92,6 +92,14 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::create( const QgsStringMap& propertie
92
92
{
93
93
layer->setOffsetUnit ( QgsSymbolLayerV2Utils::decodeOutputUnit ( properties[" offset_unit" ] ) );
94
94
}
95
+ if ( properties.contains ( " horizontal_anchor_point" ) )
96
+ {
97
+ layer->setHorizontalAnchorPoint ( QgsMarkerSymbolLayerV2::HorizontalAnchorPoint ( properties[ " horizontal_anchor_point" ].toInt () ) );
98
+ }
99
+ if ( properties.contains ( " vertical_anchor_point" ) )
100
+ {
101
+ layer->setVerticalAnchorPoint ( QgsMarkerSymbolLayerV2::VerticalAnchorPoint ( properties[ " vertical_anchor_point" ].toInt () ) );
102
+ }
95
103
96
104
// data defined properties
97
105
if ( properties.contains ( " width_expression" ) )
@@ -126,6 +134,14 @@ QgsSymbolLayerV2* QgsEllipseSymbolLayerV2::create( const QgsStringMap& propertie
126
134
{
127
135
layer->setDataDefinedProperty ( " offset" , properties[" offset_expression" ] );
128
136
}
137
+ if ( properties.contains ( " horizontal_anchor_point_expression" ) )
138
+ {
139
+ layer->setDataDefinedProperty ( " horizontal_anchor_point" , properties[ " horizontal_anchor_point_expression" ] );
140
+ }
141
+ if ( properties.contains ( " vertical_anchor_point_expression" ) )
142
+ {
143
+ layer->setDataDefinedProperty ( " vertical_anchor_point" , properties[ " vertical_anchor_point_expression" ] );
144
+ }
129
145
130
146
// compatibility with old project file format
131
147
if ( !properties[" width_field" ].isEmpty () )
@@ -199,7 +215,7 @@ void QgsEllipseSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Rend
199
215
// offset
200
216
double offsetX = 0 ;
201
217
double offsetY = 0 ;
202
- markerOffset ( context, offsetX, offsetY );
218
+ markerOffset ( context, mSymbolWidth , mSymbolHeight , mSymbolWidthUnit , mSymbolHeightUnit , offsetX, offsetY );
203
219
QPointF off ( offsetX, offsetY );
204
220
205
221
QPainter* p = context.renderContext ().painter ();
@@ -385,6 +401,8 @@ QgsStringMap QgsEllipseSymbolLayerV2::properties() const
385
401
map[" outline_color" ] = QgsSymbolLayerV2Utils::encodeColor ( mOutlineColor );
386
402
map[" offset" ] = QgsSymbolLayerV2Utils::encodePoint ( mOffset );
387
403
map[" offset_unit" ] = QgsSymbolLayerV2Utils::encodeOutputUnit ( mOffsetUnit );
404
+ map[" horizontal_anchor_point" ] = QString::number ( mHorizontalAnchorPoint );
405
+ map[" vertical_anchor_point" ] = QString::number ( mVerticalAnchorPoint );
388
406
saveDataDefinedProperties ( map );
389
407
return map;
390
408
}
0 commit comments