summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image/qpixmap.cpp')
-rw-r--r--src/gui/image/qpixmap.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 7e4597e..7b522f5 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -357,7 +357,9 @@ QPixmap QPixmap::copy(const QRect &rect) const
if (isNull())
return QPixmap();
- const QRect r = rect.isEmpty() ? QRect(0, 0, width(), height()) : rect;
+ QRect r(0, 0, width(), height());
+ if (!rect.isEmpty())
+ r = r.intersected(rect);
QPixmapData *d = data->createCompatiblePixmapData();
d->copy(data.data(), r);