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 --- src/gui/painting/qcosmeticstroker.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui/painting/qcosmeticstroker.cpp') diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 8fb5f4fd3f..e9fada10a5 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -719,10 +719,11 @@ static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc) template static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { + bool didDraw = qAbs(rx2 - rx1) + qAbs(ry2 - ry1) >= 1.0; + if (stroker->clipLine(rx1, ry1, rx2, ry2)) return true; - bool didDraw = false; const int half = stroker->legacyRounding ? 31 : 0; int x1 = toF26Dot6(rx1) + half; int y1 = toF26Dot6(ry1) + half; -- cgit v1.2.3