From 1549dff04c49aa37333e54f8bc45900d0f35b270 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Wed, 10 Feb 2021 10:44:44 +0100 Subject: Filter cosmetic lines using transformed, not world coordinates Lines smaller than 1e-12 would not be drawn even when scaled up. Pick-to: 6.1 6.0 5.15 Fixes: QTBUG-75630 Change-Id: I8f261876c325b60f61e95ca2e5fde2cb227d4cba Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qcosmeticstroker.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/painting/qcosmeticstroker.cpp') diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index daacf7a55a..a584ed5d0c 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; -- cgit v1.2.3