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 "qgscomposition.h"
|
||||||
#include "qgscomposerutils.h"
|
#include "qgscomposerutils.h"
|
||||||
#include "qgssymbollayerv2utils.h"
|
#include "qgssymbollayerv2utils.h"
|
||||||
|
#include "qgssvgcache.h"
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QSvgRenderer>
|
#include <QSvgRenderer>
|
||||||
#include <QVector2D>
|
#include <QVector2D>
|
||||||
@ -252,22 +253,14 @@ void QgsComposerArrow::drawSVGMarker( QPainter* p, MarkerType type, const QStrin
|
|||||||
imageFixPoint.setY( 0 );
|
imageFixPoint.setY( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//rasterize svg
|
QString svgFileName = ( type == StartMarker ? mStartMarkerFile : mEndMarkerFile );
|
||||||
|
if ( svgFileName.isEmpty() )
|
||||||
|
return;
|
||||||
|
|
||||||
QSvgRenderer r;
|
QSvgRenderer r;
|
||||||
if ( type == StartMarker )
|
const QByteArray &svgContent = QgsSvgCache::instance()->svgContent( svgFileName, mArrowHeadWidth, mArrowHeadFillColor, mArrowHeadOutlineColor, mArrowHeadOutlineWidth,
|
||||||
{
|
1.0, 1.0 );
|
||||||
if ( mStartMarkerFile.isEmpty() || !r.load( mStartMarkerFile ) )
|
r.load( svgContent );
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else //end marker
|
|
||||||
{
|
|
||||||
if ( mEndMarkerFile.isEmpty() || !r.load( mEndMarkerFile ) )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p->save();
|
p->save();
|
||||||
p->setRenderHint( QPainter::Antialiasing );
|
p->setRenderHint( QPainter::Antialiasing );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user