diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2010-09-20 12:54:30 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:06:57 (GMT) |
commit | de8ac0524e7ad9748d6a4f54d5d77bae7a6f3eb0 (patch) | |
tree | 06bc00a7bc541c001e280b0eb3fac07cc97da553 /tests/auto | |
parent | 0a245d03022efbc1664b4f8844e4ff9a1c71b063 (diff) | |
download | Qt-de8ac0524e7ad9748d6a4f54d5d77bae7a6f3eb0.zip Qt-de8ac0524e7ad9748d6a4f54d5d77bae7a6f3eb0.tar.gz Qt-de8ac0524e7ad9748d6a4f54d5d77bae7a6f3eb0.tar.bz2 |
Fixed scaled point drawing with square cap in raster paint engine.
With a large pen width and a small scale, due to the hacky way we draw
points (stroking a line from (x, y) to (x + tiny_amount, y)), we some
times end up snapping these two points to the same in rasterizeLine().
If we instead apply the SquareCap before we do clipping / snapping we
don't get this problem.
Task-number: QTBUG-13429
Reviewed-by: Trond
(cherry picked from commit 7c673a4cf64ba043bb27f90287517bdcdd7a21db)
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qpainter/tst_qpainter.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp index d453b50..729dd5e 100644 --- a/tests/auto/qpainter/tst_qpainter.cpp +++ b/tests/auto/qpainter/tst_qpainter.cpp @@ -251,6 +251,8 @@ private slots: void QTBUG5939_attachPainterPrivate(); + void drawPointScaled(); + private: void fillData(); void setPenColor(QPainter& p); @@ -4458,6 +4460,26 @@ void tst_QPainter::QTBUG5939_attachPainterPrivate() QCOMPARE(widget->deviceTransform, proxy->deviceTransform); } +void tst_QPainter::drawPointScaled() +{ + QImage image(32, 32, QImage::Format_RGB32); + image.fill(0xffffffff); + + QPainter p(&image); + + p.scale(0.1, 0.1); + + QPen pen; + pen.setWidth(1000); + pen.setColor(Qt::red); + + p.setPen(pen); + p.drawPoint(0, 0); + p.end(); + + QCOMPARE(image.pixel(16, 16), 0xffff0000); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" |