Skip to content

Commit 7797e80

Browse files
committedAug 9, 2016
[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
1 parent c234d80 commit 7797e80

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/core/pal/feature.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,8 @@ int FeaturePart::createCandidatesAlongLine( QList< LabelPosition* >& lPos, Point
641641

642642
if ( nbls > 0 )
643643
{
644-
//dist /= nbls;
645644
l = 0;
646-
dist = qMin( yrm, xrm );
645+
dist = qMin( qMin( yrm, xrm ), dist / mLF->layer()->pal->line_p );
647646
}
648647
else // line length < label with => centering label position
649648
{
@@ -1002,7 +1001,7 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition* >& lPos,
10021001
bool isRightToLeft = ( lineAngle > M_PI / 2 || lineAngle <= -M_PI / 2 );
10031002

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

10071006
unsigned long flags = mLF->layer()->arrangementFlags();
10081007
if ( flags == 0 )

0 commit comments

Comments
 (0)