From 8c2860672f54782c9b5e7159da476dc2882b7e1c Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Wed, 10 Feb 2021 10:44:44 +0100 Subject: [PATCH] Filter cosmetic lines using transformed, not world coordinates Lines smaller than 1e-12 would not be drawn even when scaled up. Fixes: QTBUG-75630 Change-Id: I8f261876c325b60f61e95ca2e5fde2cb227d4cba Reviewed-by: Allan Sandfeld Jensen (cherry picked from commit 1549dff04c49aa37333e54f8bc45900d0f35b270) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qcosmeticstroker.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 2b7ad91ec53..5b00362c663 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -377,14 +377,14 @@ bool QCosmeticStroker::clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2) void QCosmeticStroker::drawLine(const QPointF &p1, const QPointF &p2) { - if (p1 == p2) { + QPointF start = p1 * state->matrix; + QPointF end = p2 * state->matrix; + + if (start == end) { drawPoints(&p1, 1); return; } - QPointF start = p1 * state->matrix; - QPointF end = p2 * state->matrix; - patternOffset = state->lastPen.dashOffset()*64; lastPixel.x = INT_MIN; lastPixel.y = INT_MIN;