diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-03-31 10:03:31 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-03-31 10:03:31 +0200 |
commit | ce9519593a0b3deb99d1dd2529770f7e9fffef92 (patch) | |
tree | c9bca05230dd68f49494240ae930bad1fe0c5956 /src/gui/painting/qcosmeticstroker.cpp | |
parent | 509f77cca28aa3edea5523c5869bae4412ed2ccc (diff) | |
parent | 7baaec17edb06634f1d6235a55c7adbd112cba3e (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
mkspecs/android-g++/qmake.conf
qmake/generators/unix/unixmake2.cpp
src/gui/image/qimage_conversions.cpp
Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
Diffstat (limited to 'src/gui/painting/qcosmeticstroker.cpp')
-rw-r--r-- | src/gui/painting/qcosmeticstroker.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index f82b098012..8fb5f4fd3f 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -602,8 +602,7 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) if (!closed && drawCaps && points == end - 2) caps |= CapEnd; - QCosmeticStroker::Point last = this->lastPixel; - bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); + bool moveNextStart = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); /* fix for gaps in polylines with fastpen and aliased in a sequence of points with small distances: if current point p2 has been dropped @@ -613,14 +612,8 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) still need to update p to avoid drawing the line after this one from a bad starting position. */ - if (fastPenAliased && unclipped) { - if (last.x != lastPixel.x || last.y != lastPixel.y - || points == begin + 2 || points == end - 2) { - p = p2; - } - } else { + if (!fastPenAliased || moveNextStart || points == begin + 2 || points == end - 2) p = p2; - } points += 2; caps = NoCaps; } @@ -727,8 +720,9 @@ template<DrawPixel drawPixel, class Dasher> static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return false; + return true; + bool didDraw = false; const int half = stroker->legacyRounding ? 31 : 0; int x1 = toF26Dot6(rx1) + half; int y1 = toF26Dot6(ry1) + half; @@ -814,6 +808,7 @@ static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, dasher.adjust(); x += xinc; } while (++y < ys); + didDraw = true; } } else { // horizontal @@ -889,10 +884,11 @@ static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, dasher.adjust(); y += yinc; } while (++x < xs); + didDraw = true; } } stroker->lastPixel = last; - return true; + return didDraw; } @@ -900,7 +896,7 @@ template<DrawPixel drawPixel, class Dasher> static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) { if (stroker->clipLine(rx1, ry1, rx2, ry2)) - return false; + return true; int x1 = toF26Dot6(rx1); int y1 = toF26Dot6(ry1); |