From e110428463ac32a439bad720c4276660fd8e3023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 3 Aug 2011 09:23:07 +0200 Subject: Fixed regression introduced by 5842d19cf3dff37a85c. We need a normalized rectangle. Reviewed-by: aavit --- src/gui/painting/qpaintengine_raster.cpp | 13 +++++++++---- 1 file 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; -- cgit v0.12