Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
4.8.6, 5.5.1, 5.10.1
-
None
Description
The following code results in a 3x18 pixels dash being drawn instead of a 3x3 dot:
#include <QPainter> #include <QImage> int main() { const int w=1000, h=1000; QImage img(w, h, QImage::Format_RGBX8888); { QPainter p(&img); p.fillRect(0,0,w,h,Qt::black); p.scale(w,h); p.setPen(QPen(Qt::red, 3./w, Qt::SolidLine, Qt::RoundCap)); p.drawPoint(QPointF(0.1,0.1)); } img.save("test.png"); }
Apparently, this is due to the fact that QPaintEngineEx::drawPoints renders points as line segments of length 1/63., without any attempts to adjust the amount of this shift in X direction according to current scale (the one set by QPainter::scale).
So, either QPaintEngineEx::drawPoints should be fixed to take scale into account, or the documentation for QPainter::drawPoints should be updated to mention this peculiarity.
Attachments
Issue Links
- relates to
-
QTBUG-134255 Inconsistent rendering of 0-length lines
-
- Reported
-