Fix QPainter::drawLines() with cosmetic pen

Even though each line in the array passed to drawLines() should be
rendered as an independent line, some state was kept in the cosmetic
stroker from one line to the next. This could result in visible
rendering errors.

Fixes: QTBUG-80834
Change-Id: Ief7bf78eab83ae34459802bff5a57d6beec4a5e5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Eirik Aavitsland 2019-12-17 13:13:16 +01:00
parent 2f66ea3d69
commit 05d5268502

View File

@ -375,6 +375,7 @@ void QCosmeticStroker::drawLine(const QPointF &p1, const QPointF &p2)
patternOffset = state->lastPen.dashOffset()*64;
lastPixel.x = INT_MIN;
lastPixel.y = INT_MIN;
stroke(this, start.x(), start.y(), end.x(), end.y(), drawCaps ? CapBegin|CapEnd : 0);