|
1 | 1 | diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
|
2 |
| -index c1eb41a65d..be52c7adf1 100644 |
| 2 | +index c0a8947e71e..6653484c931 100644 |
3 | 3 | --- a/src/gui/image/qimage.cpp
|
4 | 4 | +++ b/src/gui/image/qimage.cpp
|
5 |
| -@@ -4837,13 +4837,13 @@ QImage QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode |
| 5 | +@@ -4834,25 +4834,26 @@ QImage QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode |
| 6 | + || (ws * hs) >= (1<<20) |
6 | 7 | #endif
|
7 | 8 | ) {
|
| 9 | +- QImage scaledImage; |
| 10 | ++ // Patch: no quality loss when scaling images. |
| 11 | ++ // QImage scaledImage; |
8 | 12 | if (mat.m11() < 0.0F && mat.m22() < 0.0F) { // horizontal/vertical flip
|
9 |
| -- return smoothScaled(wd, hd).mirrored(true, true).convertToFormat(format()); |
| 13 | +- scaledImage = smoothScaled(wd, hd).mirrored(true, true); |
10 | 14 | + return smoothScaled(wd, hd).mirrored(true, true);
|
11 | 15 | } else if (mat.m11() < 0.0F) { // horizontal flip
|
12 |
| -- return smoothScaled(wd, hd).mirrored(true, false).convertToFormat(format()); |
| 16 | +- scaledImage = smoothScaled(wd, hd).mirrored(true, false); |
13 | 17 | + return smoothScaled(wd, hd).mirrored(true, false);
|
14 | 18 | } else if (mat.m22() < 0.0F) { // vertical flip
|
15 |
| -- return smoothScaled(wd, hd).mirrored(false, true).convertToFormat(format()); |
| 19 | +- scaledImage = smoothScaled(wd, hd).mirrored(false, true); |
16 | 20 | + return smoothScaled(wd, hd).mirrored(false, true);
|
17 | 21 | } else { // no flipping
|
18 |
| -- return smoothScaled(wd, hd).convertToFormat(format()); |
| 22 | +- scaledImage = smoothScaled(wd, hd); |
19 | 23 | + return smoothScaled(wd, hd);
|
20 | 24 | }
|
| 25 | + |
| 26 | +- switch (format()) { |
| 27 | +- case QImage::Format_Mono: |
| 28 | +- case QImage::Format_MonoLSB: |
| 29 | +- case QImage::Format_Indexed8: |
| 30 | +- return scaledImage; |
| 31 | +- default: |
| 32 | +- return scaledImage.convertToFormat(format()); |
| 33 | +- } |
| 34 | ++ // switch (format()) { |
| 35 | ++ // case QImage::Format_Mono: |
| 36 | ++ // case QImage::Format_MonoLSB: |
| 37 | ++ // case QImage::Format_Indexed8: |
| 38 | ++ // return scaledImage; |
| 39 | ++ // default: |
| 40 | ++ // return scaledImage.convertToFormat(format()); |
| 41 | ++ // } |
21 | 42 | }
|
22 | 43 | }
|
| 44 | + |
0 commit comments