diff options
Diffstat (limited to 'src/opengl/gl2paintengineex/qtriangulatingstroker.cpp')
-rw-r--r-- | src/opengl/gl2paintengineex/qtriangulatingstroker.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp index d952988..7eae78f 100644 --- a/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp +++ b/src/opengl/gl2paintengineex/qtriangulatingstroker.cpp @@ -144,11 +144,17 @@ void QTriangulatingStroker::process(const QVectorPath &path, const QPen &pen, co m_cos_theta = qFastCos(Q_PI / m_roundness); const qreal *endPts = pts + (count<<1); - const qreal *startPts; + const qreal *startPts = 0; Qt::PenCapStyle cap = m_cap_style; if (!types) { + // skip duplicate points + while((pts + 2) < endPts && pts[0] == pts[2] && pts[1] == pts[3]) + pts += 2; + if ((pts + 2) == endPts) + return; + startPts = pts; bool endsAtStart = startPts[0] == *(endPts-2) && startPts[1] == *(endPts-1); @@ -161,15 +167,17 @@ void QTriangulatingStroker::process(const QVectorPath &path, const QPen &pen, co lineTo(pts); pts += 2; while (pts < endPts) { - join(pts); - lineTo(pts); + if (m_cx != pts[0] || m_cy != pts[1]) { + join(pts); + lineTo(pts); + } pts += 2; } endCapOrJoinClosed(startPts, pts-2, path.hasImplicitClose(), endsAtStart); } else { - bool endsAtStart; + bool endsAtStart = false; while (pts < endPts) { switch (*types) { case QPainterPath::MoveToElement: { |