Skip to content

Commit

Permalink
Disable "merge lines" option with "line direction symbol"
Browse files Browse the repository at this point in the history
This sometimes produces inversed lines and therefore unreliable results.
  • Loading branch information
m-kuhn committed Jan 22, 2017
1 parent 4a800a1 commit 2ffc041
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/app/qgslabelinggui.cpp
Expand Up @@ -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() );
}
}


Expand Down
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.cpp
Expand Up @@ -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;
Expand Down
16 changes: 11 additions & 5 deletions src/core/qgsvectorlayerlabelprovider.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 2ffc041

Please sign in to comment.