From fee16baca1e1db441c1d95952373aa324f704990 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Tue, 11 Aug 2015 14:13:51 +0200 Subject: 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 --- tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/auto') 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(10, 10) << QPointF(20, 10) << QPointF(20, 20) << QPointF(10, 20)); QTest::newRow("clipped") << (QVector() << QPoint(-10, 100) << QPoint(-1, 100) << QPoint(-1, -2) << QPoint(100, -2) << QPoint(100, 40)); // QTBUG-31579 QTest::newRow("shortsegment") << (QVector() << QPoint(20, 100) << QPoint(20, 99) << QPoint(21, 99) << QPoint(21, 104)); // QTBUG-42398 + QTest::newRow("edge") << (QVector() << 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); -- cgit v1.2.3