Skip to content
Permalink
Browse files

[composer] Make parameterised SVG arrow heads respect colors (fix #14997

)

(cherry-picked from 78c434a)
  • Loading branch information
nyalldawson committed Jul 1, 2016
1 parent 57930ea commit dc961d53501f856375bd038307697d6112d9d268
Showing with 8 additions and 15 deletions.
  1. +8 −15 src/core/composer/qgscomposerarrow.cpp
@@ -19,6 +19,7 @@
#include "qgscomposition.h"
#include "qgscomposerutils.h"
#include "qgssymbollayerv2utils.h"
#include "qgssvgcache.h"
#include <QPainter>
#include <QSvgRenderer>
#include <QVector2D>
@@ -252,22 +253,14 @@ void QgsComposerArrow::drawSVGMarker( QPainter* p, MarkerType type, const QStrin
imageFixPoint.setY( 0 );
}

//rasterize svg
QString svgFileName = ( type == StartMarker ? mStartMarkerFile : mEndMarkerFile );
if ( svgFileName.isEmpty() )
return;

QSvgRenderer r;
if ( type == StartMarker )
{
if ( mStartMarkerFile.isEmpty() || !r.load( mStartMarkerFile ) )
{
return;
}
}
else //end marker
{
if ( mEndMarkerFile.isEmpty() || !r.load( mEndMarkerFile ) )
{
return;
}
}
const QByteArray &svgContent = QgsSvgCache::instance()->svgContent( svgFileName, mArrowHeadWidth, mArrowHeadFillColor, mArrowHeadOutlineColor, mArrowHeadOutlineWidth,
1.0, 1.0 );
r.load( svgContent );

p->save();
p->setRenderHint( QPainter::Antialiasing );

0 comments on commit dc961d5

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