Skip to content

Commit

Permalink
[pal] Respect user set number of line candidates
Browse files Browse the repository at this point in the history
The number of positions used for generating line label candidates
was hardcoded and was not using the pal number of line candidate
setting.

This change means the number of line candidates can be bumped up
resulting in more candidates actually being generated and
a better final label placement

(cherry-picked from 7797e80)
  • Loading branch information
nyalldawson committed Aug 9, 2016
1 parent 785f244 commit 00e9c32
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/pal/feature.cpp
Expand Up @@ -641,9 +641,8 @@ int FeaturePart::createCandidatesAlongLine( QList< LabelPosition* >& lPos, Point

if ( nbls > 0 )
{
//dist /= nbls;
l = 0;
dist = qMin( yrm, xrm );
dist = qMin( qMin( yrm, xrm ), dist / mLF->layer()->pal->line_p );
}
else // line length < label with => centering label position
{
Expand Down Expand Up @@ -1002,7 +1001,7 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition* >& lPos,
bool isRightToLeft = ( lineAngle > M_PI / 2 || lineAngle <= -M_PI / 2 );

QLinkedList<LabelPosition*> positions;
double delta = qMax( li->label_height, total_distance / 10.0 );
double delta = qMax( li->label_height, total_distance / mLF->layer()->pal->line_p );

unsigned long flags = mLF->layer()->arrangementFlags();
if ( flags == 0 )
Expand Down

0 comments on commit 00e9c32

Please sign in to comment.