From 0806d9799a74a4d71699ea1499b24a18e264c329 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 7 Apr 2022 18:11:48 +0200 Subject: Fix misuses of 0.9999 constant Replace it with floor and round. It appears the old behavior was to work around combining ceil with inaccurate FP, but it doesn't appear this hacky ceil is needed. Change-Id: I5c16ec0fa4916e17198a733c46937fde53f2ddb5 Reviewed-by: Eirik Aavitsland --- src/gui/image/qimage.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 11de984438..a9f9a98c2c 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4783,13 +4783,8 @@ QImage QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode else if (mat.m11() == -1. && mat.m22() == -1.) return rotated180(*this); - if (mode == Qt::FastTransformation) { - hd = qRound(qAbs(mat.m22()) * hs); - wd = qRound(qAbs(mat.m11()) * ws); - } else { - hd = int(qAbs(mat.m22()) * hs + 0.9999); - wd = int(qAbs(mat.m11()) * ws + 0.9999); - } + hd = qRound(qAbs(mat.m22()) * hs); + wd = qRound(qAbs(mat.m11()) * ws); scale_xform = true; // The paint-based scaling is only bilinear, and has problems // with scaling smoothly more than 2x down. -- cgit v1.2.3