Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[symbology] Fix custom dash pattern for line with an hairline (i.e. 0…
…) width
  • Loading branch information
nirvn committed Apr 26, 2019
1 parent 175426e commit 99450f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/symbology/qgslinesymbollayer.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 99450f6

Please sign in to comment.