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 | |
parent | eb5d8d2fc30bb9588320eaada0abf1e69bddf980 (diff) |
Fix missing devicePixelRatio propagation on copy.
Change-Id: I0cb541fe8a92b7a7c159e0a6e5036baf43185a93
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r-- | src/gui/image/qimage.cpp | 1 | ||||
-rw-r--r-- | src/gui/image/qpixmap_raster.cpp | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 481cb37c8c..7287f54e74 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -1126,6 +1126,7 @@ QImage QImage::copy(const QRect& r) const image.d->colortable = d->colortable; image.d->dpmx = d->dpmx; image.d->dpmy = d->dpmy; + image.d->devicePixelRatio = d->devicePixelRatio; image.d->offset = d->offset; image.d->has_alpha_clut = d->has_alpha_clut; image.d->text = d->text; 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 |