don't stroke a path if it's not specified in the SVG

upstream commits:
14fa3c45fc

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-01-13 16:29:46 +02:00
parent da7bb6270d
commit d702f0f982
3 changed files with 4 additions and 7 deletions

View file

@ -398,6 +398,7 @@ public:
qWarning("Unhandled cap style");
}
switch (spen.joinStyle()) {
case Qt::SvgMiterJoin:
case Qt::MiterJoin:
stream() << "stroke-linejoin=\"miter\" "
"stroke-miterlimit=\""<<spen.miterLimit()<<"\" ";
@ -408,10 +409,6 @@ public:
case Qt::RoundJoin:
stream() << "stroke-linejoin=\"round\" ";
break;
case Qt::SvgMiterJoin:
stream() << "stroke-linejoin=\"miter\" "
"stroke-miterlimit=\""<<spen.miterLimit()<<"\" ";
break;
default:
qWarning("Unhandled join style");
}

View file

@ -210,7 +210,7 @@ QRectF QSvgNode::transformedBounds() const
QPainter p(&dummy);
QSvgExtraStates states;
QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::SvgMiterJoin);
pen.setMiterLimit(4);
p.setPen(pen);

View file

@ -240,7 +240,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QRectF &bounds)
//sets default style on the painter
//### not the most optimal way
mapSourceToTarget(p, bounds);
QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::SvgMiterJoin);
pen.setMiterLimit(4);
p->setPen(pen);
p->setBrush(Qt::black);
@ -283,7 +283,7 @@ void QSvgTinyDocument::draw(QPainter *p, const QString &id,
QTransform originalTransform = p->worldTransform();
//XXX set default style on the painter
QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
QPen pen(Qt::NoBrush, 1, Qt::SolidLine, Qt::FlatCap, Qt::SvgMiterJoin);
pen.setMiterLimit(4);
p->setPen(pen);
p->setBrush(Qt::black);