diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-10-20 15:48:39 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2014-10-20 20:52:18 +0200 |
commit | aaa06d6c82e02961f92690b10c84a0030dc0ebb7 (patch) | |
tree | 688cef55df80ad9197a6af313d3c382f83434f05 /src | |
parent | 14fa3c45fcc71f1b5b7c84ae23a1f7a5d2f22e9e (diff) | |
download | qtsvg-aaa06d6c82e02961f92690b10c84a0030dc0ebb7.tar.gz |
Correctly handle Miter joins in all cases
SVG uses SvgMiterJoin, not the Qt definition of miter
joins at all times.
Change-Id: I85b8e13609fa37384f09457f724a42d720769028
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/svg/qsvggenerator.cpp | 5 | ||||
-rw-r--r-- | src/svg/qsvgnode.cpp | 2 | ||||
-rw-r--r-- | src/svg/qsvgtinydocument.cpp | 4 |
3 files changed, 4 insertions, 7 deletions
diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp index 6a12043..5d58fa3 100644 --- a/src/svg/qsvggenerator.cpp +++ b/src/svg/qsvggenerator.cpp @@ -390,6 +390,7 @@ public: qWarning("Unhandled cap style"); } switch (spen.joinStyle()) { + case Qt::SvgMiterJoin: case Qt::MiterJoin: stream() << "stroke-linejoin=\"miter\" " "stroke-miterlimit=\""<<spen.miterLimit()<<"\" "; @@ -400,10 +401,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"); } diff --git a/src/svg/qsvgnode.cpp b/src/svg/qsvgnode.cpp index fdb5348..10a8828 100644 --- a/src/svg/qsvgnode.cpp +++ b/src/svg/qsvgnode.cpp @@ -200,7 +200,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); diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp index 71b1263..88e9224 100644 --- a/src/svg/qsvgtinydocument.cpp +++ b/src/svg/qsvgtinydocument.cpp @@ -230,7 +230,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); @@ -273,7 +273,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); |