mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-10 00:13:55 -04:00
[pal] When labels can be placed both above and below the line, prefer above
This commit is contained in:
parent
655fc93cef
commit
99521f456a
@ -1067,9 +1067,15 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition* >& lPos,
|
|||||||
if ( i == 0 && (( !reversed && ( flags & FLAG_ABOVE_LINE ) ) || ( reversed && ( flags & FLAG_BELOW_LINE ) ) ) )
|
if ( i == 0 && (( !reversed && ( flags & FLAG_ABOVE_LINE ) ) || ( reversed && ( flags & FLAG_BELOW_LINE ) ) ) )
|
||||||
p = _createCurvedCandidate( slp, angle_avg, mLF->distLabel() + li->label_height / 2 );
|
p = _createCurvedCandidate( slp, angle_avg, mLF->distLabel() + li->label_height / 2 );
|
||||||
if ( i == 1 && flags & FLAG_ON_LINE )
|
if ( i == 1 && flags & FLAG_ON_LINE )
|
||||||
|
{
|
||||||
p = _createCurvedCandidate( slp, angle_avg, 0 );
|
p = _createCurvedCandidate( slp, angle_avg, 0 );
|
||||||
|
p->setCost( p->cost() + 0.002 );
|
||||||
|
}
|
||||||
if ( i == 2 && (( !reversed && ( flags & FLAG_BELOW_LINE ) ) || ( reversed && ( flags & FLAG_ABOVE_LINE ) ) ) )
|
if ( i == 2 && (( !reversed && ( flags & FLAG_BELOW_LINE ) ) || ( reversed && ( flags & FLAG_ABOVE_LINE ) ) ) )
|
||||||
|
{
|
||||||
p = _createCurvedCandidate( slp, angle_avg, -li->label_height / 2 - mLF->distLabel() );
|
p = _createCurvedCandidate( slp, angle_avg, -li->label_height / 2 - mLF->distLabel() );
|
||||||
|
p->setCost( p->cost() + 0.001 );
|
||||||
|
}
|
||||||
|
|
||||||
if ( p && mLF->permissibleZonePrepared() )
|
if ( p && mLF->permissibleZonePrepared() )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user