Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.9.5, 5.12.3
-
None
-
Ubuntu 18.04.2 LTS
Description
Consider the following test code:
#include <QPainter> #include <QSvgGenerator> const int w=100, h=100; void test(QPaintDevice& dev) { QPainter painter(&dev); painter.setBrush(Qt::darkGreen); painter.drawRect(0,0,w,h); auto pen=QPen(Qt::white,w/36.*4/w); pen.setJoinStyle(Qt::MiterJoin); // QSvgGenerator ignores this painter.setPen(pen); painter.scale(w,w); const QVector<QPointF> points={{0.4,0.6},{0.6,0.5},{0.4,0.4}}; painter.drawPolyline(points.data(), points.size()); } int main() { QSvgGenerator generator; generator.setFileName("test.svg"); generator.setViewBox(QRect(0,0,w,h)); test(generator); QImage img(w,h,QImage::Format_RGBA8888); test(img); img.save("test.png"); }
If you run it, you'll get two output files in current directory: test.png and test.svg. In the PNG one there's an arrow-like acute angle, while in the SVG file the arrow is chopped: join style is BevelJoin, the default.
The expected result is that SVG file looks the same as the PNG one (up to antialiasing).