Skip to content

Commit 2ffc041

Browse files
committed
Disable "merge lines" option with "line direction symbol"
This sometimes produces inversed lines and therefore unreliable results.
1 parent 4a800a1 commit 2ffc041

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

src/app/qgslabelinggui.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,16 @@ void QgsLabelingGui::updateUi()
853853
syncDefinedCheckboxFrame( mFormatNumDDBtn, mFormatNumChkBx, mFormatNumFrame );
854854
syncDefinedCheckboxFrame( mScaleBasedVisibilityDDBtn, mScaleBasedVisibilityChkBx, mScaleBasedVisibilityFrame );
855855
syncDefinedCheckboxFrame( mFontLimitPixelDDBtn, mFontLimitPixelChkBox, mFontLimitPixelFrame );
856+
857+
chkMergeLines->setEnabled( !mDirectSymbChkBx->isChecked() );
858+
if ( mDirectSymbChkBx->isChecked() )
859+
{
860+
chkMergeLines->setToolTip( tr( "This option is not compatible with line direction symbols." ) );
861+
}
862+
else
863+
{
864+
chkMergeLines->setToolTip( QString() );
865+
}
856866
}
857867

858868

src/core/qgspallabeling.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ QgsPalLayerSettings& QgsPalLayerSettings::operator=( const QgsPalLayerSettings &
351351
upsidedownLabels = s.upsidedownLabels;
352352

353353
labelPerPart = s.labelPerPart;
354-
mergeLines = s.mergeLines;
354+
mergeLines = s.mergeLines && !s.addDirectionSymbol;
355355
minFeatureSize = s.minFeatureSize;
356356
limitNumLabels = s.limitNumLabels;
357357
maxNumLabels = s.maxNumLabels;

src/core/qgsvectorlayerlabelprovider.cpp

+11-5
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,17 @@ void QgsVectorLayerLabelProvider::init()
8383
mPlacement = mSettings.placement;
8484
mLinePlacementFlags = mSettings.placementFlags;
8585
mFlags = Flags();
86-
if ( mSettings.drawLabels ) mFlags |= DrawLabels;
87-
if ( mSettings.displayAll ) mFlags |= DrawAllLabels;
88-
if ( mSettings.mergeLines ) mFlags |= MergeConnectedLines;
89-
if ( mSettings.centroidInside ) mFlags |= CentroidMustBeInside;
90-
if ( mSettings.labelPerPart ) mFlags |= LabelPerFeaturePart;
86+
if ( mSettings.drawLabels )
87+
mFlags |= DrawLabels;
88+
if ( mSettings.displayAll )
89+
mFlags |= DrawAllLabels;
90+
if ( mSettings.mergeLines && !mSettings.addDirectionSymbol )
91+
mFlags |= MergeConnectedLines;
92+
if ( mSettings.centroidInside )
93+
mFlags |= CentroidMustBeInside;
94+
if ( mSettings.labelPerPart )
95+
mFlags |= LabelPerFeaturePart;
96+
9197
mPriority = 1 - mSettings.priority / 10.0; // convert 0..10 --> 1..0
9298

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

0 commit comments

Comments
 (0)