Skip to content
Permalink
Browse files

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@12791 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jan 18, 2010
1 parent 2d8123d commit 78792070d7679b3b81e4c0b95002dc182965d00a
@@ -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" )
{
@@ -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();
}

}
@@ -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 )
@@ -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 )
{

0 comments on commit 7879207

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