Skip to content

Commit

Permalink
Added vertical line to simple marker symbol layer.
Browse files Browse the repository at this point in the history
Added rotation for ellipse, cross and line markers.


git-svn-id: http://svn.osgeo.org/qgis/trunk@12791 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jan 18, 2010
1 parent 2d8123d commit 7879207
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Expand Up @@ -235,7 +235,11 @@ void QgsSimpleMarkerSymbolLayerV2::drawMarker( QPainter* p, QgsSymbolV2RenderCon
{
double scaledSize = context.outputPixelSize( mSize );
double half = scaledSize / 2.0;
// TODO: rotate
if ( mAngle != 0 )
{
p->save();
p->rotate( mAngle );
}

if ( mName == "circle" )
{
Expand All @@ -251,6 +255,13 @@ void QgsSimpleMarkerSymbolLayerV2::drawMarker( QPainter* p, QgsSymbolV2RenderCon
p->drawLine( QPointF( -half, -half ), QPointF( half, half ) );
p->drawLine( QPointF( -half, half ), QPointF( half, -half ) );
}
else if ( mName == "line" )
{
p->drawLine( QPointF( 0, -half ), QPointF( 0, half ) ); // vertical line
}

if ( mAngle != 0 )
p->restore();
}

}
Expand Down Expand Up @@ -327,7 +338,7 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re
}

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

if ( mAngle != 0 )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgssymbollayerv2widget.cpp
Expand Up @@ -161,7 +161,7 @@ QgsSimpleMarkerSymbolLayerV2Widget::QgsSimpleMarkerSymbolLayerV2Widget( QWidget*
QSize size = lstNames->iconSize();
QStringList names;
names << "circle" << "rectangle" << "diamond" << "pentagon" << "cross" << "cross2" << "triangle"
<< "equilateral_triangle" << "star" << "regular_star" << "arrow";
<< "equilateral_triangle" << "star" << "regular_star" << "arrow" << "line";
double markerSize = size.width() - 1; // keep some space around
for ( int i = 0; i < names.count(); ++i )
{
Expand Down

0 comments on commit 7879207

Please sign in to comment.