summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-09 09:41:30 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-10 11:20:19 (GMT)
commit82e78e6797a99ffba279247731d43915d69890a4 (patch)
tree3260e4368d5eef7d38fff3b789cb0efc9fa1bb8a
parentc05fc777cac9a585567c83508b0e39cc3f86e7f6 (diff)
downloadQt-82e78e6797a99ffba279247731d43915d69890a4.zip
Qt-82e78e6797a99ffba279247731d43915d69890a4.tar.gz
Qt-82e78e6797a99ffba279247731d43915d69890a4.tar.bz2
Fixed QPixmapDropShadowFilter and updated its testcase
Reivewed-by: Samuel
-rw-r--r--src/gui/image/qpixmapfilter.cpp4
-rw-r--r--tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index de8f4e0..650aeaa 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -1064,9 +1064,7 @@ void QPixmapDropShadowFilter::setOffset(const QPointF &offset)
QRectF QPixmapDropShadowFilter::boundingRectFor(const QRectF &rect) const
{
Q_D(const QPixmapDropShadowFilter);
- qreal delta = d->radius + 1;
- return rect.adjusted(-2, -2, 2, 2).united(
- rect.translated(d->offset).adjusted(-delta, -delta, delta, delta));
+ return rect.united(rect.translated(d->offset).adjusted(-d->radius, -d->radius, d->radius, d->radius));
}
/*!
diff --git a/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp b/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp
index 3f5c3d3..b9c6b01 100644
--- a/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp
+++ b/tests/auto/qpixmapfilter/tst_qpixmapfilter.cpp
@@ -407,7 +407,7 @@ void tst_QPixmapFilter::dropShadowBoundingRectFor()
filter.setBlurRadius(2);
filter.setOffset(QPointF(0,0));
- int delta = 2 + 1;
+ qreal delta = 2;
QCOMPARE(filter.boundingRectFor(rect1), rect1.adjusted(-delta, -delta, delta, delta));
QCOMPARE(filter.boundingRectFor(rect2), rect2.adjusted(-delta, -delta, delta, delta));
QCOMPARE(filter.boundingRectFor(rect3), rect3.adjusted(-delta, -delta, delta, delta));