File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -127,12 +127,21 @@ void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context
127
127
mPen .setStyle ( Qt::CustomDashLine );
128
128
129
129
// scale pattern vector
130
+ double dashWidthDiv = scaledWidth;
131
+ // fix dash pattern width in Qt 4.8
132
+ QStringList versionSplit = QString ( qVersion () ).split ( " ." );
133
+ if ( versionSplit.size () > 1
134
+ && versionSplit.at ( 1 ).toInt () >= 8
135
+ && ( scaledWidth * context.renderContext ().rasterScaleFactor () ) < 1.0 )
136
+ {
137
+ dashWidthDiv = 1.0 ;
138
+ }
130
139
QVector<qreal> scaledVector;
131
140
QVector<qreal>::const_iterator it = mCustomDashVector .constBegin ();
132
141
for ( ; it != mCustomDashVector .constEnd (); ++it )
133
142
{
134
143
// the dash is specified in terms of pen widths, therefore the division
135
- scaledVector << ( *it ) * QgsSymbolLayerV2Utils::lineWidthScaleFactor ( context.renderContext (), mCustomDashPatternUnit ) / scaledWidth ;
144
+ scaledVector << ( *it ) * QgsSymbolLayerV2Utils::lineWidthScaleFactor ( context.renderContext (), mCustomDashPatternUnit ) / dashWidthDiv ;
136
145
}
137
146
mPen .setDashPattern ( scaledVector );
138
147
}
You can’t perform that action at this time.
0 commit comments