diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index ccabbde..5677fc2 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -361,7 +361,7 @@ void QDeclarativeRectangle::generateRoundedRect()
             }
             p.setBrush(d->color);
             if (pw%2)
-                p.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)), d->radius, d->radius);
+                p.drawRoundedRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+2), d->rectImage.height()-(pw+2)), d->radius, d->radius);
             else
                 p.drawRoundedRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw), d->radius, d->radius);
             QPixmapCache::insert(key, d->rectImage);
@@ -393,7 +393,7 @@ void QDeclarativeRectangle::generateBorderedRect()
             }
             p.setBrush(d->color);
             if (pw%2)
-                p.drawRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+1), d->rectImage.height()-(pw+1)));
+                p.drawRect(QRectF(qreal(pw)/2+1, qreal(pw)/2+1, d->rectImage.width()-(pw+2), d->rectImage.height()-(pw+2)));
             else
                 p.drawRect(QRectF(qreal(pw)/2, qreal(pw)/2, d->rectImage.width()-pw, d->rectImage.height()-pw));
             QPixmapCache::insert(key, d->rectImage);
