diff options
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 13 |
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; |