summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@theqtcompany.com>2015-08-11 14:13:51 +0200
committeraavit <eirik.aavitsland@theqtcompany.com>2015-09-01 08:21:45 +0000
commitfee16baca1e1db441c1d95952373aa324f704990 (patch)
tree08c5364939b1a73f651ef7656ddec4adb22b4bb4 /tests/auto
parent17aaaad653e08f566aabb26dfc6b6958fa79ca03 (diff)
Another fix of cosmetic QPainter::drawPolyline()
At the edge of the view, a line segment could end up as not producing any pixels even if not clipped by the floating-point clip routine. Make sure the starting point for the next line is still updated correctly for any significant segment lengths. Change-Id: I381a4efb81ce6006f3da4c67abf279aea79e4663 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 6582755aec..752ab0fd8c 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -4885,6 +4885,7 @@ void tst_QPainter::drawPolyline_data()
QTest::newRow("basic") << (QVector<QPointF>() << QPointF(10, 10) << QPointF(20, 10) << QPointF(20, 20) << QPointF(10, 20));
QTest::newRow("clipped") << (QVector<QPointF>() << QPoint(-10, 100) << QPoint(-1, 100) << QPoint(-1, -2) << QPoint(100, -2) << QPoint(100, 40)); // QTBUG-31579
QTest::newRow("shortsegment") << (QVector<QPointF>() << QPoint(20, 100) << QPoint(20, 99) << QPoint(21, 99) << QPoint(21, 104)); // QTBUG-42398
+ QTest::newRow("edge") << (QVector<QPointF>() << QPointF(4.5, 121.6) << QPointF(9.4, 150.9) << QPointF(14.2, 184.8) << QPointF(19.1, 130.4));
}
void tst_QPainter::drawPolyline()
@@ -4894,7 +4895,7 @@ void tst_QPainter::drawPolyline()
for (int r = 0; r < 2; r++) {
images[r] = QImage(150, 150, QImage::Format_ARGB32);
- images[r].fill(Qt::transparent);
+ images[r].fill(Qt::white);
QPainter p(images + r);
QPen pen(Qt::red, 0, Qt::SolidLine, Qt::FlatCap);
p.setPen(pen);