From 721d143c89833dc15ae76810089180bf562ac707 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 21 Jan 2020 17:04:36 +0300 Subject: [PATCH] Fix rounding of sparse QImage-s. --- ui/image/image_prepare.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/image/image_prepare.cpp b/ui/image/image_prepare.cpp index b2c2270..176e307 100644 --- a/ui/image/image_prepare.cpp +++ b/ui/image/image_prepare.cpp @@ -469,10 +469,10 @@ void prepareRound( Assert(image.bytesPerLine() == (imageIntsPerLine << 2)); auto ints = reinterpret_cast(image.bits()); - auto intsTopLeft = ints + target.x() + target.y() * imageWidth; - auto intsTopRight = ints + target.x() + target.width() - cornerWidth + target.y() * imageWidth; - auto intsBottomLeft = ints + target.x() + (target.y() + target.height() - cornerHeight) * imageWidth; - auto intsBottomRight = ints + target.x() + target.width() - cornerWidth + (target.y() + target.height() - cornerHeight) * imageWidth; + auto intsTopLeft = ints + target.x() + target.y() * imageIntsPerLine; + auto intsTopRight = ints + target.x() + target.width() - cornerWidth + target.y() * imageIntsPerLine; + auto intsBottomLeft = ints + target.x() + (target.y() + target.height() - cornerHeight) * imageIntsPerLine; + auto intsBottomRight = ints + target.x() + target.width() - cornerWidth + (target.y() + target.height() - cornerHeight) * imageIntsPerLine; auto maskCorner = [&](uint32 *imageInts, const QImage &mask) { auto maskWidth = mask.width(); auto maskHeight = mask.height();