Skip to content
Permalink
Browse files
Disable "merge lines" option with "line direction symbol"
This sometimes produces inversed lines and therefore unreliable results.
  • Loading branch information
m-kuhn committed Jan 22, 2017
1 parent 4a800a1 commit 2ffc041fa9aaf6c42ce4231c311611da3f3b1f12
Showing with 22 additions and 6 deletions.
  1. +10 −0 src/app/qgslabelinggui.cpp
  2. +1 −1 src/core/qgspallabeling.cpp
  3. +11 −5 src/core/qgsvectorlayerlabelprovider.cpp
@@ -853,6 +853,16 @@ void QgsLabelingGui::updateUi()
syncDefinedCheckboxFrame( mFormatNumDDBtn, mFormatNumChkBx, mFormatNumFrame );
syncDefinedCheckboxFrame( mScaleBasedVisibilityDDBtn, mScaleBasedVisibilityChkBx, mScaleBasedVisibilityFrame );
syncDefinedCheckboxFrame( mFontLimitPixelDDBtn, mFontLimitPixelChkBox, mFontLimitPixelFrame );

chkMergeLines->setEnabled( !mDirectSymbChkBx->isChecked() );
if ( mDirectSymbChkBx->isChecked() )
{
chkMergeLines->setToolTip( tr( "This option is not compatible with line direction symbols." ) );
}
else
{
chkMergeLines->setToolTip( QString() );
}
}


@@ -351,7 +351,7 @@ QgsPalLayerSettings& QgsPalLayerSettings::operator=( const QgsPalLayerSettings &
upsidedownLabels = s.upsidedownLabels;

labelPerPart = s.labelPerPart;
mergeLines = s.mergeLines;
mergeLines = s.mergeLines && !s.addDirectionSymbol;
minFeatureSize = s.minFeatureSize;
limitNumLabels = s.limitNumLabels;
maxNumLabels = s.maxNumLabels;
@@ -83,11 +83,17 @@ void QgsVectorLayerLabelProvider::init()
mPlacement = mSettings.placement;
mLinePlacementFlags = mSettings.placementFlags;
mFlags = Flags();
if ( mSettings.drawLabels ) mFlags |= DrawLabels;
if ( mSettings.displayAll ) mFlags |= DrawAllLabels;
if ( mSettings.mergeLines ) mFlags |= MergeConnectedLines;
if ( mSettings.centroidInside ) mFlags |= CentroidMustBeInside;
if ( mSettings.labelPerPart ) mFlags |= LabelPerFeaturePart;
if ( mSettings.drawLabels )
mFlags |= DrawLabels;
if ( mSettings.displayAll )
mFlags |= DrawAllLabels;
if ( mSettings.mergeLines && !mSettings.addDirectionSymbol )
mFlags |= MergeConnectedLines;
if ( mSettings.centroidInside )
mFlags |= CentroidMustBeInside;
if ( mSettings.labelPerPart )
mFlags |= LabelPerFeaturePart;

mPriority = 1 - mSettings.priority / 10.0; // convert 0..10 --> 1..0

if ( mLayerGeometryType == QgsWkbTypes::PointGeometry && mRenderer )

0 comments on commit 2ffc041

Please sign in to comment.