diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-03-07 10:16:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-29 09:47:32 +0100 |
commit | 7b9d45311c241e352cd5b813f22a149cac3de339 (patch) | |
tree | e8b8ca6c535d89d6728c1cbcb79b1cdfa6ac6812 /src/gui/image/qpixmap_raster.cpp | |
parent | eb5d8d2fc30bb9588320eaada0abf1e69bddf980 (diff) |
Fix missing devicePixelRatio propagation on copy.
Change-Id: I0cb541fe8a92b7a7c159e0a6e5036baf43185a93
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/gui/image/qpixmap_raster.cpp')
-rw-r--r-- | src/gui/image/qpixmap_raster.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 8d5891aae2..302945dbf8 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -240,12 +240,14 @@ QImage QRasterPlatformPixmap::toImage(const QRect &rect) const QRect clipped = rect.intersected(QRect(0, 0, w, h)); const uint du = uint(d); - if ((du % 8 == 0) && (((uint(clipped.x()) * du)) % 32 == 0)) - return QImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8), + if ((du % 8 == 0) && (((uint(clipped.x()) * du)) % 32 == 0)) { + QImage newImage(image.scanLine(clipped.y()) + clipped.x() * (du / 8), clipped.width(), clipped.height(), image.bytesPerLine(), image.format()); - else + return newImage; + } else { return image.copy(clipped); + } } QPaintEngine* QRasterPlatformPixmap::paintEngine() const |