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
  • Loading branch information
nyalldawson committed Aug 8, 2016
1 parent c234d80 commit 7797e80c66d236fba8524042bc8a3e971de4ab07
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 7797e80

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