Skip to content

Commit b3b372d

Browse files
committed
Bump default number of label candidates
Results in much nicer label placement and little to no speed regression in most cases (cherry-picked from ed69bf2)
1 parent 4e69a3e commit b3b372d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/core/pal/pal.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ Pal::Pal()
7171

7272
setSearch( CHAIN );
7373

74-
point_p = 8;
75-
line_p = 8;
76-
poly_p = 8;
74+
point_p = 16;
75+
line_p = 50;
76+
poly_p = 30;
7777

7878
showPartial = true;
7979
}

src/core/qgslabelingenginev2.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ class QgsLabelSorter
7171
QgsLabelingEngineV2::QgsLabelingEngineV2()
7272
: mFlags( RenderOutlineLabels | UsePartialCandidates )
7373
, mSearchMethod( QgsPalLabeling::Chain )
74-
, mCandPoint( 8 )
75-
, mCandLine( 8 )
76-
, mCandPolygon( 8 )
74+
, mCandPoint( 16 )
75+
, mCandLine( 50 )
76+
, mCandPolygon( 30 )
7777
, mResults( nullptr )
7878
{
7979
mResults = new QgsLabelingResults;
@@ -343,9 +343,9 @@ void QgsLabelingEngineV2::readSettingsFromProject()
343343
bool saved = false;
344344
QgsProject* prj = QgsProject::instance();
345345
mSearchMethod = static_cast< QgsPalLabeling::Search >( prj->readNumEntry( "PAL", "/SearchMethod", static_cast< int >( QgsPalLabeling::Chain ), &saved ) );
346-
mCandPoint = prj->readNumEntry( "PAL", "/CandidatesPoint", 8, &saved );
347-
mCandLine = prj->readNumEntry( "PAL", "/CandidatesLine", 8, &saved );
348-
mCandPolygon = prj->readNumEntry( "PAL", "/CandidatesPolygon", 8, &saved );
346+
mCandPoint = prj->readNumEntry( "PAL", "/CandidatesPoint", 16, &saved );
347+
mCandLine = prj->readNumEntry( "PAL", "/CandidatesLine", 50, &saved );
348+
mCandPolygon = prj->readNumEntry( "PAL", "/CandidatesPolygon", 30, &saved );
349349

350350
mFlags = nullptr;
351351
if ( prj->readBoolEntry( "PAL", "/ShowingCandidates", false, &saved ) ) mFlags |= DrawCandidates;

0 commit comments

Comments
 (0)