From 4c04017737f7b80bd0a5032e732c2c75efd03f8e Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 13 Aug 2020 15:10:42 +0400 Subject: [PATCH] Fix checks in small image round request. --- ui/image/image_prepare.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/image/image_prepare.cpp b/ui/image/image_prepare.cpp index c774456..d372b22 100644 --- a/ui/image/image_prepare.cpp +++ b/ui/image/image_prepare.cpp @@ -458,9 +458,9 @@ void prepareRound( } auto cornerWidth = cornerMasks[0].width(); auto cornerHeight = cornerMasks[0].height(); - auto imageWidth = image.width(); - auto imageHeight = image.height(); - if (imageWidth < 2 * cornerWidth || imageHeight < 2 * cornerHeight) { + auto targetWidth = target.width(); + auto targetHeight = target.height(); + if (targetWidth < 2 * cornerWidth || targetHeight < 2 * cornerHeight) { return; } @@ -475,9 +475,9 @@ void prepareRound( Assert(image.depth() == static_cast((imageIntsPerPixel * sizeof(uint32)) << 3)); Assert(image.bytesPerLine() == (imageIntsPerLine << 2)); 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 intsTopRight = ints + target.x() + targetWidth - cornerWidth + target.y() * imageIntsPerLine; + auto intsBottomLeft = ints + target.x() + (target.y() + targetHeight - cornerHeight) * imageIntsPerLine; + auto intsBottomRight = ints + target.x() + targetWidth - cornerWidth + (target.y() + targetHeight - cornerHeight) * imageIntsPerLine; auto maskCorner = [&](uint32 *imageInts, const QImage &mask) { auto maskWidth = mask.width(); auto maskHeight = mask.height();