Skip to content

Commit

Permalink
[composer] Make parameterised SVG arrow heads respect colors (fix #14997
Browse files Browse the repository at this point in the history
)

(cherry-picked from 78c434a)
  • Loading branch information
nyalldawson committed Jul 1, 2016
1 parent 57930ea commit dc961d5
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/core/composer/qgscomposerarrow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "qgscomposition.h"
#include "qgscomposerutils.h"
#include "qgssymbollayerv2utils.h"
#include "qgssvgcache.h"
#include <QPainter>
#include <QSvgRenderer>
#include <QVector2D>
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit dc961d5

Please sign in to comment.