@@ -342,14 +342,48 @@ void QgsSimpleLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
342
342
mPen .setColor ( QColor ( mStrokeColorExpression ->evaluate ( const_cast <QgsFeature*>( context.feature () ) ).toString () ) );
343
343
}
344
344
345
+ // offset
346
+ double offset = mOffset ;
347
+ if ( mLineOffsetExpression )
348
+ {
349
+ offset = mLineOffsetExpression ->evaluate ( const_cast <QgsFeature*>( context.feature () ) ).toDouble ();
350
+ }
351
+
352
+ // dash dot vector
353
+ if ( mDashPatternExpression )
354
+ {
355
+ QVector<qreal> dashVector;
356
+ QStringList dashList = mDashPatternExpression ->evaluate ( const_cast <QgsFeature*>( context.feature () ) ).toString ().split ( " ;" );
357
+ QStringList::const_iterator dashIt = dashList.constBegin ();
358
+ for ( ; dashIt != dashList.constEnd (); ++dashIt )
359
+ {
360
+ dashVector.push_back ( dashIt->toDouble () * QgsSymbolLayerV2Utils::lineWidthScaleFactor ( context.renderContext (), mCustomDashPatternUnit ) / mPen .widthF () );
361
+ }
362
+ mPen .setDashPattern ( dashVector );
363
+ }
364
+
365
+ // join style
366
+ if ( mJoinStyleExpression )
367
+ {
368
+ QString joinStyleString = mJoinStyleExpression ->evaluate ( const_cast <QgsFeature*>( context.feature () ) ).toString ();
369
+ mPen .setJoinStyle ( QgsSymbolLayerV2Utils::decodePenJoinStyle ( joinStyleString ) );
370
+ }
371
+
372
+ // cap style
373
+ if ( mCapStyleExpression )
374
+ {
375
+ QString capStyleString = mCapStyleExpression ->evaluate ( const_cast <QgsFeature*>( context.feature () ) ).toString ();
376
+ mPen .setCapStyle ( QgsSymbolLayerV2Utils::decodePenCapStyle ( capStyleString ) );
377
+ }
345
378
p->setPen ( context.selected () ? mSelPen : mPen );
346
- if ( mOffset == 0 )
379
+
380
+ if ( offset == 0 )
347
381
{
348
382
p->drawPolyline ( points );
349
383
}
350
384
else
351
385
{
352
- double scaledOffset = mOffset * QgsSymbolLayerV2Utils::lineWidthScaleFactor ( context.renderContext (), mOffsetUnit );
386
+ double scaledOffset = offset * QgsSymbolLayerV2Utils::lineWidthScaleFactor ( context.renderContext (), mOffsetUnit );
353
387
p->drawPolyline ( ::offsetLine ( points, scaledOffset ) );
354
388
}
355
389
}
0 commit comments