From 9b24932eba2b204852c4f2b35e05bd7d9d47ccea Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Tue, 9 Nov 2010 12:40:48 +1000 Subject: Fix Rectangle painting at small sizes. We require a minimum size of 5x5 for the border image caching to work. Task-number: QTBUG-15135 Reviewed-by: Michael Brasser --- src/declarative/graphicsitems/qdeclarativerectangle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp index 1ffd3bd..fc3954f 100644 --- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp +++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp @@ -477,7 +477,8 @@ void QDeclarativeRectangle::drawRect(QPainter &p) { Q_D(QDeclarativeRectangle); if ((d->gradient && d->gradient->gradient()) - || d->radius > width()/2 || d->radius > height()/2) { + || d->radius > width()/2 || d->radius > height()/2 + || width() < 3 || height() < 3) { // XXX This path is still slower than the image path // Image path won't work for gradients or invalid radius though bool oldAA = p.testRenderHint(QPainter::Antialiasing); -- cgit v0.12