Skip to content

Commit

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

Please sign in to comment.