mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
[composer] Make parameterised SVG arrow heads respect colors (fix #14997)
This commit is contained in:
parent
44db212aa1
commit
78c434a6c4
@ -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 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user