summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcosmeticstroker.cpp
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 /src/gui/painting/qcosmeticstroker.cpp
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 'src/gui/painting/qcosmeticstroker.cpp')
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp3
1 files changed, 2 insertions, 1 deletions
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<DrawPixel drawPixel, class Dasher>
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;