Skip to content

Commit

Permalink
[pal] When labels can be placed both above and below the line, prefer…
Browse files Browse the repository at this point in the history
… above

(cherry-picked from 99521f4)
  • Loading branch information
nyalldawson committed Aug 9, 2016
1 parent 93389a8 commit 4e69a3e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/pal/feature.cpp
Expand Up @@ -1067,9 +1067,15 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition* >& lPos,
if ( i == 0 && (( !reversed && ( flags & FLAG_ABOVE_LINE ) ) || ( reversed && ( flags & FLAG_BELOW_LINE ) ) ) )
p = _createCurvedCandidate( slp, angle_avg, mLF->distLabel() + li->label_height / 2 );
if ( i == 1 && flags & FLAG_ON_LINE )
{
p = _createCurvedCandidate( slp, angle_avg, 0 );
p->setCost( p->cost() + 0.002 );
}
if ( i == 2 && (( !reversed && ( flags & FLAG_BELOW_LINE ) ) || ( reversed && ( flags & FLAG_ABOVE_LINE ) ) ) )
{
p = _createCurvedCandidate( slp, angle_avg, -li->label_height / 2 - mLF->distLabel() );
p->setCost( p->cost() + 0.001 );
}

if ( p && mLF->permissibleZonePrepared() )
{
Expand Down

0 comments on commit 4e69a3e

Please sign in to comment.