summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-04-14 12:59:20 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-14 20:58:39 +0000
commit8eeae7ae073ddd71a9210c0d3d1edaa6c199f509 (patch)
treea50365ca22cda8483adf180c479838770cfe9e47
parent6869d2463a2e0d71bd04dbc82f5d6ef4933dc510 (diff)
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 <eirik.aavitsland@qt.io> (cherry picked from commit 004189b2d8e751021f26d9eb28948f753ea8208c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/gui/painting/qrasterizer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp
index 48d41f41f0..e851a3876a 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 {