Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.4
-
None
Description
The bug itself was found in the QtSvg module, but it also can be reproduced by a simple example:
#include <QGuiApplication> #include <QImage> #include <QPainter> int main(int argc, char *argv[]) { QGuiApplication a(argc, argv); QImage img(200, 200, QImage::Format_ARGB32); img.fill(Qt::transparent); QPainter p(&img); p.setRenderHint(QPainter::Antialiasing); p.setTransform(QTransform(1, 0, -0.57735026919, 1, 0, 0)); // skewX(-30) QRadialGradient rg(0.5, 0.5, 0.5, 0.5, 0.5); rg.setCoordinateMode(QGradient::ObjectBoundingMode); rg.setColorAt(0, Qt::white); rg.setColorAt(1, Qt::black); QBrush brush(rg); brush.setTransform(QTransform(0.86602540378, 0.5, -0.5, 0.86602540378, 0, 0)); // rotate(30) p.setPen(Qt::NoPen); p.setBrush(brush); p.drawRect(100, 40, 110, 110); p.end(); img.save("test.png"); return 0; }
Attachments
Issue Links
- duplicates
-
QTBUG-59978 When using a transformation on a gradient in a SVG file then it is not transformed correctly
- Closed
For Gerrit Dashboard: QTBUG-67995 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
201920,6 | Add ObjectMode coordinate mode to QGradient | dev | qt/qtbase | Status: MERGED | +2 | 0 |
228189,2 | Fix transformation of gradients for svg objectBoundingBox coordinates | dev | qt/qtsvg | Status: MERGED | +2 | 0 |