summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-06-19 10:45:47 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-06-22 08:58:43 (GMT)
commit18940f4953bfdc08b7ee8cfe9067ead6282b06a4 (patch)
treea21958ce0ee16cd99d0975c00eafd456cecb4df3 /src
parentfe48ca11f7da7200c052a7825ad4d46319b13cc5 (diff)
downloadQt-18940f4953bfdc08b7ee8cfe9067ead6282b06a4.zip
Qt-18940f4953bfdc08b7ee8cfe9067ead6282b06a4.tar.gz
Qt-18940f4953bfdc08b7ee8cfe9067ead6282b06a4.tar.bz2
Fixed rounding bug in raster paint engine rect / image drawing.
Change 855aa89e0ba99f8a0f75d7b31930bab2cefb93f8 incorrectly changed toNormalizedFillRect to use int truncation instead of qRound. This fixes the autotest failure in tst_QPainter::drawRect2 as well. Reviewed-by: Trond
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 78515ac..37f7b6d 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -1771,10 +1771,10 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
static inline QRect toNormalizedFillRect(const QRectF &rect)
{
- int x1 = int(rect.x() + aliasedCoordinateDelta);
- int y1 = int(rect.y() + aliasedCoordinateDelta);
- int x2 = int(rect.right() + aliasedCoordinateDelta);
- int y2 = int(rect.bottom() + aliasedCoordinateDelta);
+ int x1 = qRound(rect.x() + aliasedCoordinateDelta);
+ int y1 = qRound(rect.y() + aliasedCoordinateDelta);
+ int x2 = qRound(rect.right() + aliasedCoordinateDelta);
+ int y2 = qRound(rect.bottom() + aliasedCoordinateDelta);
if (x2 < x1)
qSwap(x1, x2);