Skip to content

Commit 99450f6

Browse files
committed
[symbology] Fix custom dash pattern for line with an hairline (i.e. 0) width
1 parent 175426e commit 99450f6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/symbology/qgslinesymbollayer.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,13 @@ void QgsSimpleLineSymbolLayer::startRender( QgsSymbolRenderContext &context )
194194
mPen.setColor( penColor );
195195
double scaledWidth = context.renderContext().convertToPainterUnits( mWidth, mWidthUnit, mWidthMapUnitScale );
196196
mPen.setWidthF( scaledWidth );
197-
if ( mUseCustomDashPattern && !qgsDoubleNear( scaledWidth, 0 ) )
197+
if ( mUseCustomDashPattern )
198198
{
199199
mPen.setStyle( Qt::CustomDashLine );
200200

201201
//scale pattern vector
202-
double dashWidthDiv = scaledWidth;
202+
double dashWidthDiv = qgsDoubleNear( scaledWidth, 0 ) ? 1.0 : scaledWidth;
203+
203204
//fix dash pattern width in Qt 4.8
204205
QStringList versionSplit = QString( qVersion() ).split( '.' );
205206
if ( versionSplit.size() > 1

0 commit comments

Comments
 (0)