summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine_raster.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-05-06 07:43:32 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-05-06 08:01:58 (GMT)
commitffbb3c1a2aee4134dce80cd144a26bf32865b698 (patch)
tree3f633a0cd4911d355d84c6109c44a4c71734f7c4 /src/gui/painting/qpaintengine_raster.cpp
parenta1d2c3c589a03cc427dcc22d109003576add9500 (diff)
downloadQt-ffbb3c1a2aee4134dce80cd144a26bf32865b698.zip
Qt-ffbb3c1a2aee4134dce80cd144a26bf32865b698.tar.gz
Qt-ffbb3c1a2aee4134dce80cd144a26bf32865b698.tar.bz2
Fixed some inconsistencies for image drawing on non-integer coords.
Don't use aliased coordinate delta for image drawing. Related to change fde7475bcf9c10522a8170e6eb8fb9a8fadc21cd. Task-number: 251561 Reviewed-by: Trond
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 788b722..cbfd5e3 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2573,7 +2573,11 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
QRasterPaintEngineState *s = state();
const bool aa = s->flags.antialiased || s->flags.bilinear;
if (!aa && sr.size() == QSize(1, 1)) {
- fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y())));
+ // as fillRect will apply the aliased coordinate delta we need to
+ // subtract it here as we don't use it for image drawing
+ const QRectF targetRect = r.translated(-aliasedCoordinateDelta,
+ -aliasedCoordinateDelta);
+ fillRect(targetRect, QColor::fromRgba(img.pixel(sr.x(), sr.y())));
return;
}