Skip to content
Permalink
Browse files

[pal] Respect user set number of line candidates

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 00e9c323aee8439a3370c7c1a71168fe0eeaedea
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/core/pal/feature.cpp
@@ -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
{
@@ -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 )

0 comments on commit 00e9c32

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