Skip to content

Commit 0e99d43

Browse files
committedOct 10, 2011
Fix shift in point displacement renderer
1 parent f075f7e commit 0e99d43

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎src/plugins/point_displacement_renderer/qgspointdisplacementrenderer.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,17 @@ void QgsPointDisplacementRenderer::calculateSymbolAndLabelPositions( const QPoin
481481
symbolPositions.clear();
482482
labelShifts.clear();
483483

484+
if ( nPosition < 1 )
485+
{
486+
return;
487+
}
488+
else if ( nPosition == 1 ) //If there is only one feature, draw it exactly at the center position
489+
{
490+
symbolPositions.append( centerPoint );
491+
labelShifts.append( QPointF( symbolDiagonal / 2.0, -symbolDiagonal / 2.0 ) );
492+
return;
493+
}
494+
484495
double fullPerimeter = 2 * M_PI;
485496
double angleStep = fullPerimeter / nPosition;
486497
double currentAngle;

0 commit comments

Comments
 (0)
Please sign in to comment.