diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-04-07 18:11:48 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-06-02 07:29:39 +0200 |
commit | 0806d9799a74a4d71699ea1499b24a18e264c329 (patch) | |
tree | 64eab45b48aa64f41d48836ff62a33b36205b556 /src/gui/image/qimage.cpp | |
parent | bc922223cf11eae34a5e7ad311258da1c030124f (diff) |
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 <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r-- | src/gui/image/qimage.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
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. |