Skip to content

Commit

Permalink
Remove more set by unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 17, 2022
1 parent eb7812e commit 56ddeab
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/core/pal/labelposition.cpp
Expand Up @@ -649,21 +649,20 @@ double LabelPosition::polygonIntersectionCostForParts( PointSet *polygon ) const

double LabelPosition::angleDifferential()
{
double angleDiff = 0.0, angleLast = 0.0, diff;
double sinAvg = 0, cosAvg = 0;
double angleDiff = 0.0;
double angleLast = 0.0;
LabelPosition *tmp = this;
while ( tmp )
{
if ( tmp != this ) // not first?
{
diff = std::fabs( tmp->getAlpha() - angleLast );
if ( diff > 2 * M_PI ) diff -= 2 * M_PI;
double diff = std::fabs( tmp->getAlpha() - angleLast );
if ( diff > 2 * M_PI )
diff -= 2 * M_PI;
diff = std::min( diff, 2 * M_PI - diff ); // difference 350 deg is actually just 10 deg...
angleDiff += diff;
}

sinAvg += std::sin( tmp->getAlpha() );
cosAvg += std::cos( tmp->getAlpha() );
angleLast = tmp->getAlpha();
tmp = tmp->nextPart();
}
Expand Down

0 comments on commit 56ddeab

Please sign in to comment.