Skip to content

Commit

Permalink
Fix shift in point displacement renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent authored and mach0 committed Nov 13, 2011
1 parent 34927da commit 34c3f0d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,17 @@ void QgsPointDisplacementRenderer::calculateSymbolAndLabelPositions( const QPoin
symbolPositions.clear();
labelShifts.clear();

if ( nPosition < 1 )
{
return;
}
else if ( nPosition == 1 ) //If there is only one feature, draw it exactly at the center position
{
symbolPositions.append( centerPoint );
labelShifts.append( QPointF( symbolDiagonal / 2.0, -symbolDiagonal / 2.0 ) );
return;
}

double fullPerimeter = 2 * M_PI;
double angleStep = fullPerimeter / nPosition;
double currentAngle;
Expand Down

0 comments on commit 34c3f0d

Please sign in to comment.