Skip to content

Commit 6a39ad8

Browse files
author
wonder
committedJan 18, 2010
Added vertical line to simple marker symbol layer.
Added rotation for ellipse, cross and line markers. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12791 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
 

‎src/core/symbology-ng/qgsmarkersymbollayerv2.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ void QgsSimpleMarkerSymbolLayerV2::drawMarker( QPainter* p, QgsSymbolV2RenderCon
235235
{
236236
double scaledSize = context.outputPixelSize( mSize );
237237
double half = scaledSize / 2.0;
238-
// TODO: rotate
238+
if ( mAngle != 0 )
239+
{
240+
p->save();
241+
p->rotate( mAngle );
242+
}
239243

240244
if ( mName == "circle" )
241245
{
@@ -251,6 +255,13 @@ void QgsSimpleMarkerSymbolLayerV2::drawMarker( QPainter* p, QgsSymbolV2RenderCon
251255
p->drawLine( QPointF( -half, -half ), QPointF( half, half ) );
252256
p->drawLine( QPointF( -half, half ), QPointF( half, -half ) );
253257
}
258+
else if ( mName == "line" )
259+
{
260+
p->drawLine( QPointF( 0, -half ), QPointF( 0, half ) ); // vertical line
261+
}
262+
263+
if ( mAngle != 0 )
264+
p->restore();
254265
}
255266

256267
}
@@ -327,7 +338,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
327338
}
328339

329340
p->save();
330-
QPointF outputOffset = QPointF(context.outputLineWidth( mOffset.x() ), context.outputLineWidth( mOffset.y() ) );
341+
QPointF outputOffset = QPointF( context.outputLineWidth( mOffset.x() ), context.outputLineWidth( mOffset.y() ) );
331342
p->translate( point + outputOffset );
332343

333344
if ( mAngle != 0 )

‎src/gui/symbology-ng/qgssymbollayerv2widget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ QgsSimpleMarkerSymbolLayerV2Widget::QgsSimpleMarkerSymbolLayerV2Widget( QWidget*
161161
QSize size = lstNames->iconSize();
162162
QStringList names;
163163
names << "circle" << "rectangle" << "diamond" << "pentagon" << "cross" << "cross2" << "triangle"
164-
<< "equilateral_triangle" << "star" << "regular_star" << "arrow";
164+
<< "equilateral_triangle" << "star" << "regular_star" << "arrow" << "line";
165165
double markerSize = size.width() - 1; // keep some space around
166166
for ( int i = 0; i < names.count(); ++i )
167167
{

0 commit comments

Comments
 (0)
Please sign in to comment.