From edbbe996d33d17ae8020fb06611141586fd1e7bb Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Mon, 20 Feb 2023 12:41:18 +0100 Subject: [PATCH] effects/contrast: Round device coordinates when creating geometry Since normal geometry is now rounded, we need to make sure to round anything that should match that geometry, otherwise we risk things peeking out of the normal geometry. BUG: 464526 --- src/effects/backgroundcontrast/contrast.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/effects/backgroundcontrast/contrast.cpp b/src/effects/backgroundcontrast/contrast.cpp index c672f91d6e..8921a481e3 100644 --- a/src/effects/backgroundcontrast/contrast.cpp +++ b/src/effects/backgroundcontrast/contrast.cpp @@ -313,10 +313,10 @@ void ContrastEffect::uploadRegion(QVector2D *&map, const QRegion ®ion, qreal Q_ASSERT(map); for (const QRect &r : region) { const auto deviceRect = scaledRect(r, scale); - const QVector2D topLeft(deviceRect.x(), deviceRect.y()); - const QVector2D topRight(deviceRect.x() + deviceRect.width(), deviceRect.y()); - const QVector2D bottomLeft(deviceRect.x(), deviceRect.y() + deviceRect.height()); - const QVector2D bottomRight(deviceRect.x() + deviceRect.width(), deviceRect.y() + deviceRect.height()); + const QVector2D topLeft = roundVector(QVector2D(deviceRect.x(), deviceRect.y())); + const QVector2D topRight = roundVector(QVector2D(deviceRect.x() + deviceRect.width(), deviceRect.y())); + const QVector2D bottomLeft = roundVector(QVector2D(deviceRect.x(), deviceRect.y() + deviceRect.height())); + const QVector2D bottomRight = roundVector(QVector2D(deviceRect.x() + deviceRect.width(), deviceRect.y() + deviceRect.height())); // First triangle *(map++) = topRight;