mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
[labeling] Don't waste time trying to generate curved labels on lines
where the label length is greater then the line length
This commit is contained in:
parent
e227e93d0b
commit
e1bd4e9210
@ -1173,6 +1173,18 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition * > &lPos
|
||||
return 0;
|
||||
}
|
||||
|
||||
double totalCharacterWidth = 0;
|
||||
for ( int i = 0; i < li->char_num; ++i )
|
||||
totalCharacterWidth += li->char_info[ i ].width;
|
||||
|
||||
if ( totalCharacterWidth > total_distance )
|
||||
{
|
||||
// label doesn't fit on this line, don't waste time trying to make candidates
|
||||
// TODO - in future allow this, and allow label to overlap end of line
|
||||
delete[] path_distances;
|
||||
return 0;
|
||||
}
|
||||
|
||||
QLinkedList<LabelPosition *> positions;
|
||||
double delta = std::max( li->label_height, total_distance / mLF->layer()->pal->line_p );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user