Skip to content
Permalink
Browse files

[pal] When labels can be placed both above and below the line, prefer…

… above

(cherry-picked from 99521f4)
  • Loading branch information
nyalldawson committed Aug 9, 2016
1 parent 93389a8 commit 4e69a3e080c385f29eb038a812a1f000c547130c
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/pal/feature.cpp
@@ -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() )
{

0 comments on commit 4e69a3e

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