From b3b372d94cc75e862fa4cca0c3630724a31d3b79 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 10 Aug 2016 08:16:00 +1000 Subject: [PATCH] Bump default number of label candidates Results in much nicer label placement and little to no speed regression in most cases (cherry-picked from ed69bf26b2df4d38304605c0c1fe21cc00531a13) --- src/core/pal/pal.cpp | 6 +++--- src/core/qgslabelingenginev2.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/pal/pal.cpp b/src/core/pal/pal.cpp index cf57d3993bbc..fefb4d84c1b1 100644 --- a/src/core/pal/pal.cpp +++ b/src/core/pal/pal.cpp @@ -71,9 +71,9 @@ Pal::Pal() setSearch( CHAIN ); - point_p = 8; - line_p = 8; - poly_p = 8; + point_p = 16; + line_p = 50; + poly_p = 30; showPartial = true; } diff --git a/src/core/qgslabelingenginev2.cpp b/src/core/qgslabelingenginev2.cpp index 5bc40b60d558..55ca7ae8f138 100644 --- a/src/core/qgslabelingenginev2.cpp +++ b/src/core/qgslabelingenginev2.cpp @@ -71,9 +71,9 @@ class QgsLabelSorter QgsLabelingEngineV2::QgsLabelingEngineV2() : mFlags( RenderOutlineLabels | UsePartialCandidates ) , mSearchMethod( QgsPalLabeling::Chain ) - , mCandPoint( 8 ) - , mCandLine( 8 ) - , mCandPolygon( 8 ) + , mCandPoint( 16 ) + , mCandLine( 50 ) + , mCandPolygon( 30 ) , mResults( nullptr ) { mResults = new QgsLabelingResults; @@ -343,9 +343,9 @@ void QgsLabelingEngineV2::readSettingsFromProject() bool saved = false; QgsProject* prj = QgsProject::instance(); mSearchMethod = static_cast< QgsPalLabeling::Search >( prj->readNumEntry( "PAL", "/SearchMethod", static_cast< int >( QgsPalLabeling::Chain ), &saved ) ); - mCandPoint = prj->readNumEntry( "PAL", "/CandidatesPoint", 8, &saved ); - mCandLine = prj->readNumEntry( "PAL", "/CandidatesLine", 8, &saved ); - mCandPolygon = prj->readNumEntry( "PAL", "/CandidatesPolygon", 8, &saved ); + mCandPoint = prj->readNumEntry( "PAL", "/CandidatesPoint", 16, &saved ); + mCandLine = prj->readNumEntry( "PAL", "/CandidatesLine", 50, &saved ); + mCandPolygon = prj->readNumEntry( "PAL", "/CandidatesPolygon", 30, &saved ); mFlags = nullptr; if ( prj->readBoolEntry( "PAL", "/ShowingCandidates", false, &saved ) ) mFlags |= DrawCandidates;