summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-08-03 07:23:07 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2011-08-03 08:19:52 (GMT)
commite110428463ac32a439bad720c4276660fd8e3023 (patch)
treef42dc7d2d17a396a0358ec01b138d43c806e5741
parentb3187d850aa6e0a4818e2a982d13aab77ca20a82 (diff)
downloadQt-e110428463ac32a439bad720c4276660fd8e3023.zip
Qt-e110428463ac32a439bad720c4276660fd8e3023.tar.gz
Qt-e110428463ac32a439bad720c4276660fd8e3023.tar.bz2
Fixed regression introduced by 5842d19cf3dff37a85c.
We need a normalized rectangle. Reviewed-by: aavit
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index d77ef82..76d7316 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2399,10 +2399,15 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
QPointF rr_tl = s->matrix.map(r.topLeft());
QPointF rr_br = s->matrix.map(r.bottomRight());
- const int x1 = qRound(rr_tl.x());
- const int y1 = qRound(rr_tl.y());
- const int x2 = qRound(rr_br.x());
- const int y2 = qRound(rr_br.y());
+ int x1 = qRound(rr_tl.x());
+ int y1 = qRound(rr_tl.y());
+ int x2 = qRound(rr_br.x());
+ int y2 = qRound(rr_br.y());
+
+ if (x1 > x2)
+ qSwap(x1, x2);
+ if (y1 > y2)
+ qSwap(y1, y2);
fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler_xform, d);
return;