From 8eeae7ae073ddd71a9210c0d3d1edaa6c199f509 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 14 Apr 2021 12:59:20 +0200 Subject: [PATCH] Fix partial pixel coverage calculation We want right - left, but the numbers we have are (1 - left) and right, so we need right - (1 - left) = right + left - 1. Fixes: QTBUG-91957 Fixes: QTBUG-92485 Change-Id: I238cbbe1eebddff1ce56da38127899cdbd21db0e Reviewed-by: Eirik Aavitsland (cherry picked from commit 004189b2d8e751021f26d9eb28948f753ea8208c) Reviewed-by: Qt Cherry-pick Bot --- src/gui/painting/qrasterizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 48d41f41f02..e851a3876a7 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -864,7 +864,7 @@ void QRasterizer::rasterizeLine(const QPointF &a, const QPointF &b, qreal width, if (leftWidth == QScFixedFactor) coverage[0] = rightWidth * 255; else - coverage[0] = (leftWidth + rightWidth) * 255; + coverage[0] = (rightWidth + leftWidth - QScFixedFactor) * 255; x[0] = iLeft; len[0] = 1; } else {