Skip to content

Commit 4e69a3e

Browse files
committedAug 9, 2016
[pal] When labels can be placed both above and below the line, prefer above
(cherry-picked from 99521f4)
1 parent 93389a8 commit 4e69a3e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎src/core/pal/feature.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,9 +1067,15 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition* >& lPos,
10671067
if ( i == 0 && (( !reversed && ( flags & FLAG_ABOVE_LINE ) ) || ( reversed && ( flags & FLAG_BELOW_LINE ) ) ) )
10681068
p = _createCurvedCandidate( slp, angle_avg, mLF->distLabel() + li->label_height / 2 );
10691069
if ( i == 1 && flags & FLAG_ON_LINE )
1070+
{
10701071
p = _createCurvedCandidate( slp, angle_avg, 0 );
1072+
p->setCost( p->cost() + 0.002 );
1073+
}
10711074
if ( i == 2 && (( !reversed && ( flags & FLAG_BELOW_LINE ) ) || ( reversed && ( flags & FLAG_ABOVE_LINE ) ) ) )
1075+
{
10721076
p = _createCurvedCandidate( slp, angle_avg, -li->label_height / 2 - mLF->distLabel() );
1077+
p->setCost( p->cost() + 0.001 );
1078+
}
10731079

10741080
if ( p && mLF->permissibleZonePrepared() )
10751081
{

0 commit comments

Comments
 (0)
Please sign in to comment.