Skip to content
Permalink
Browse files

[symbology] Fix custom dash pattern for line with an hairline (i.e. 0…

…) width
  • Loading branch information
nirvn committed Apr 26, 2019
1 parent 761b478 commit 6a4efe88baef10a6be8799331278e08772423176
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/core/symbology/qgslinesymbollayer.cpp
@@ -194,12 +194,13 @@ void QgsSimpleLineSymbolLayer::startRender( QgsSymbolRenderContext &context )
mPen.setColor( penColor );
double scaledWidth = context.renderContext().convertToPainterUnits( mWidth, mWidthUnit, mWidthMapUnitScale );
mPen.setWidthF( scaledWidth );
if ( mUseCustomDashPattern && !qgsDoubleNear( scaledWidth, 0 ) )
if ( mUseCustomDashPattern )
{
mPen.setStyle( Qt::CustomDashLine );

//scale pattern vector
double dashWidthDiv = scaledWidth;
double dashWidthDiv = qgsDoubleNear( scaledWidth, 0 ) ? 1.0 : scaledWidth;

//fix dash pattern width in Qt 4.8
QStringList versionSplit = QString( qVersion() ).split( '.' );
if ( versionSplit.size() > 1

0 comments on commit 6a4efe8

Please sign in to comment.
You can’t perform that action at this time.