Skip to content

Commit

Permalink
Bump default number of label candidates
Browse files Browse the repository at this point in the history
Results in much nicer label placement and little to no speed
regression in most cases
  • Loading branch information
nyalldawson committed Jul 27, 2016
1 parent 5f33991 commit cd22d4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/core/pal/pal.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ Pal::Pal()


setSearch( CHAIN ); setSearch( CHAIN );


point_p = 8; point_p = 16;
line_p = 8; line_p = 50;
poly_p = 8; poly_p = 30;


showPartial = true; showPartial = true;
} }
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgslabelingenginev2.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ class QgsLabelSorter
QgsLabelingEngineV2::QgsLabelingEngineV2() QgsLabelingEngineV2::QgsLabelingEngineV2()
: mFlags( RenderOutlineLabels | UsePartialCandidates ) : mFlags( RenderOutlineLabels | UsePartialCandidates )
, mSearchMethod( QgsPalLabeling::Chain ) , mSearchMethod( QgsPalLabeling::Chain )
, mCandPoint( 8 ) , mCandPoint( 16 )
, mCandLine( 8 ) , mCandLine( 50 )
, mCandPolygon( 8 ) , mCandPolygon( 30 )
, mResults( nullptr ) , mResults( nullptr )
{ {
mResults = new QgsLabelingResults; mResults = new QgsLabelingResults;
Expand Down Expand Up @@ -346,9 +346,9 @@ void QgsLabelingEngineV2::readSettingsFromProject()
bool saved = false; bool saved = false;
QgsProject* prj = QgsProject::instance(); QgsProject* prj = QgsProject::instance();
mSearchMethod = static_cast< QgsPalLabeling::Search >( prj->readNumEntry( "PAL", "/SearchMethod", static_cast< int >( QgsPalLabeling::Chain ), &saved ) ); mSearchMethod = static_cast< QgsPalLabeling::Search >( prj->readNumEntry( "PAL", "/SearchMethod", static_cast< int >( QgsPalLabeling::Chain ), &saved ) );
mCandPoint = prj->readNumEntry( "PAL", "/CandidatesPoint", 8, &saved ); mCandPoint = prj->readNumEntry( "PAL", "/CandidatesPoint", 16, &saved );
mCandLine = prj->readNumEntry( "PAL", "/CandidatesLine", 8, &saved ); mCandLine = prj->readNumEntry( "PAL", "/CandidatesLine", 50, &saved );
mCandPolygon = prj->readNumEntry( "PAL", "/CandidatesPolygon", 8, &saved ); mCandPolygon = prj->readNumEntry( "PAL", "/CandidatesPolygon", 30, &saved );


mFlags = 0; mFlags = 0;
if ( prj->readBoolEntry( "PAL", "/ShowingCandidates", false, &saved ) ) mFlags |= DrawCandidates; if ( prj->readBoolEntry( "PAL", "/ShowingCandidates", false, &saved ) ) mFlags |= DrawCandidates;
Expand Down

0 comments on commit cd22d4f

Please sign in to comment.